Shaka Player Embedded
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
shaka Namespace Reference

Namespaces

 eme
 
 impl
 
 js
 
 media
 
 memory
 
 proto
 
 util
 

Classes

class  Any
 
class  AsyncResults
 
class  BackingObject
 
class  BackingObjectFactory
 
class  BackingObjectFactoryBase
 
class  BackingObjectFactoryRegistry
 
class  BufferedInfo
 
class  BufferedRange
 
class  ByteBuffer
 
class  ByteString
 
class  Callback
 
class  DebugMutex
 
struct  DefaultValueType
 
class  DrmInfo
 
class  Environment
 
class  Error
 
struct  ExceptionOr
 
struct  ExceptionOr< void >
 
class  GenericConverter
 
class  InitDataOverride
 
struct  is_optional
 
struct  is_optional< optional< T > >
 
class  JsEngine
 
class  JsManager
 
class  JsManagerImpl
 
class  JsObjectWrapper
 
class  LanguageRole
 
class  Member
 
struct  monostate
 
class  Mutex
 
class  NetworkFilters
 
class  NetworkThread
 
struct  nullopt_t
 
class  optional
 
class  Player
 
class  Promise
 
class  PseudoSingleton
 
struct  Rational
 
class  RefPtr
 
class  RejectedPromiseHandler
 
class  Request
 
class  Response
 
class  SchemePlugin
 
class  SdlFrameDrawer
 
struct  ShakaRect
 
class  SharedMutex
 
class  StateChange
 
class  Stats
 
class  Storage
 
class  StoredContent
 
class  Struct
 
class  TaskRunner
 
class  Thread
 
class  ThreadEvent
 
class  ThreadEventBase
 
class  Track
 
class  TrackChoice
 
struct  TypeName
 
struct  TypeName< BackingObject, void >
 
struct  TypeName< bool, void >
 
struct  TypeName< shaka::optional< T > >
 
struct  TypeName< shaka::variant< Types... > >
 
struct  TypeName< std::string, void >
 
struct  TypeName< std::vector< T >, void >
 
struct  TypeName< StoredContent, void >
 
struct  TypeName< T *, void >
 
struct  TypeName< T, util::enable_if_t< util::is_number< T >::value > >
 
class  variant
 
struct  variant_alternative
 
struct  variant_alternative< I, variant< Choices... > >
 
class  Waitable
 
class  WaitingTracker
 
class  WeakJsPtr
 

Typedefs

template<size_t I, typename Variant >
using variant_alternative_t = typename variant_alternative< I, Variant >::type
 

Enumerations

enum  RequestType : int8_t {
  RequestType::Unknown = -1, RequestType::Manifest = 0, RequestType::Segment = 1, RequestType::License = 2,
  RequestType::App = 3, RequestType::Timing = 4
}
 
enum  VideoFillMode : uint8_t { VideoFillMode::MaintainRatio, VideoFillMode::Stretch, VideoFillMode::Zoom }
 
enum  TaskPriority { TaskPriority::Timer, TaskPriority::Internal, TaskPriority::Events, TaskPriority::Immediate }
 
enum  ExceptionCode {
  IndexSizeError, HierarchyRequestError, WrongDocumentError, InvalidCharacterError,
  NoModificationAllowedError, NotFoundError, NotSupportedError, InUseAttributeError,
  InvalidStateError, SyntaxError, InvalidModificationError, NamespaceError,
  InvalidAccessError, TypeMismatchError, SecurityError, NetworkError,
  AbortError, URLMismatchError, QuotaExceededError, TimeoutError,
  InvalidNodeTypeError, DataCloneError, EncodingError, NotReadableError,
  UnknownError, ConstraintError, DataError, TransactionInactiveError,
  ReadOnlyError, VersionError, OperationError, NotAllowedError,
  MaxExceptionCode
}
 

Functions

std::ostream & operator<< (std::ostream &os, const Error &error)
 
template<class A , class B >
bool operator== (const optional< A > &lhs, const optional< B > &rhs)
 
template<class A , class B >
bool operator!= (const optional< A > &lhs, const optional< B > &rhs)
 
template<class A , class B >
bool operator< (const optional< A > &lhs, const optional< B > &rhs)
 
template<class A , class B >
bool operator<= (const optional< A > &lhs, const optional< B > &rhs)
 
template<class A , class B >
bool operator> (const optional< A > &lhs, const optional< B > &rhs)
 
template<class A , class B >
bool operator>= (const optional< A > &lhs, const optional< B > &rhs)
 
template<class T >
bool operator== (const optional< T > &opt, nullopt_t)
 
template<class T >
bool operator== (nullopt_t, const optional< T > &opt)
 
template<class T >
bool operator!= (const optional< T > &opt, nullopt_t)
 
template<class T >
bool operator!= (nullopt_t, const optional< T > &opt)
 
template<class T >
bool operator< (const optional< T > &opt, nullopt_t)
 
template<class T >
bool operator< (nullopt_t, const optional< T > &opt)
 
template<class T >
bool operator<= (const optional< T > &opt, nullopt_t)
 
template<class T >
bool operator<= (nullopt_t, const optional< T > &opt)
 
template<class T >
bool operator> (const optional< T > &opt, nullopt_t)
 
template<class T >
bool operator> (nullopt_t, const optional< T > &opt)
 
template<class T >
bool operator>= (const optional< T > &opt, nullopt_t)
 
template<class T >
bool operator>= (nullopt_t, const optional< T > &opt)
 
template<class A , class B >
bool operator== (const optional< A > &opt, const B &value)
 
template<class A , class B >
bool operator== (const A &value, const optional< B > &opt)
 
template<class A , class B >
bool operator!= (const optional< A > &opt, const B &value)
 
template<class A , class B >
bool operator!= (const A &value, const optional< B > &opt)
 
template<class A , class B >
bool operator< (const optional< A > &opt, const B &value)
 
template<class A , class B >
bool operator< (const A &value, const optional< B > &opt)
 
template<class A , class B >
bool operator<= (const optional< A > &opt, const B &value)
 
template<class A , class B >
bool operator<= (const A &value, const optional< B > &opt)
 
template<class A , class B >
bool operator> (const optional< A > &opt, const B &value)
 
template<class A , class B >
bool operator> (const A &value, const optional< B > &opt)
 
template<class A , class B >
bool operator>= (const optional< A > &opt, const B &value)
 
template<class A , class B >
bool operator>= (const A &value, const optional< B > &opt)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const ShakaRect< T > &rect)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const Rational< T > &bar)
 
template<typename T , typename U , typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
Rational< typename std::common_type< T, U >::typeoperator* (T a, const Rational< U > &b)
 
template<typename T , typename U , typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
Rational< typename std::common_type< T, U >::typeoperator/ (T a, const Rational< U > &b)
 
void FitVideoToRegion (ShakaRect< uint32_t > frame, ShakaRect< uint32_t > bounds, Rational< uint32_t > sample_aspect_ratio, VideoFillMode mode, ShakaRect< uint32_t > *src, ShakaRect< uint32_t > *dest)
 
std::string EscapeKeySystem (const std::string &key_system)
 
std::string LicenseServerConfig (const std::string &key_system)
 
std::string AdvancedDrmConfig (const std::string &key_system, const std::string &property)
 
template<typename... Choices>
bool operator== (const variant< Choices... > &lhs, const variant< Choices... > &rhs)
 
template<typename... Choices>
bool operator!= (const variant< Choices... > &lhs, const variant< Choices... > &rhs)
 
template<typename T , typename... Choices>
bool holds_alternative (const variant< Choices... > &variant)
 
template<size_t I, typename... Choices>
impl::get_const_reference_at_t< I, Choices... > get (const variant< Choices... > &variant)
 
template<size_t I, typename... Choices>
variant_alternative_t< I, variant< Choices... > > & get (variant< Choices... > &variant)
 
template<typename T , typename... Choices>
const T & get (const variant< Choices... > &variant)
 
template<typename T , typename... Choices>
T & get (variant< Choices... > &variant)
 
template<typename T , typename... Choices>
T && get (variant< Choices... > &&variant)
 
template<size_t I, typename... Choices>
std::add_const< variant_alternative_t< I, variant< Choices... > > >::typeget_if (const variant< Choices... > &variant)
 
template<size_t I, typename... Choices>
variant_alternative_t< I, variant< Choices... > > * get_if (variant< Choices... > &variant)
 
template<typename T , typename... Choices>
const T * get_if (const variant< Choices... > &variant)
 
template<typename T , typename... Choices>
T * get_if (variant< Choices... > &variant)
 
void RegisterDefaultKeySystems ()
 
template<typename... Args>
std::function< void(Args...)> MainThreadCallback (std::function< void(Args...)> cb)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, RefPtr< T > arg)
 
bool operator== (const ByteBuffer &lhs, const ByteBuffer &rhs)
 
bool operator!= (const ByteBuffer &lhs, const ByteBuffer &rhs)
 
template<typename T >
bool FromJsValue (Handle< JsValue > source, T *dest)
 
template<typename T >
ReturnVal< JsValue > ToJsValue (T &&source)
 
ReturnVal< JsValue > GetDescendant (Handle< JsObject > root, const std::vector< std::string > &names)
 
void HandleNetworkFuture (Promise promise, std::future< optional< Error >> future, std::function< void()> on_done)
 
template<typename T , typename... Args>
RefPtr< T > MakeJsRef (Args &&... args)
 
size_t ArgumentCount (const CallbackArguments &arguments)
 
std::vector< std::string > GetMemberNames (Handle< JsObject > object)
 
ReturnVal< JsValue > GetMemberRaw (Handle< JsObject > object, const std::string &name, LocalVar< JsValue > *exception=nullptr)
 
ReturnVal< JsValue > GetArrayIndexRaw (Handle< JsObject > object, size_t index, LocalVar< JsValue > *exception=nullptr)
 
void SetMemberRaw (Handle< JsObject > object, const std::string &name, Handle< JsValue > value)
 
void SetArrayIndexRaw (Handle< JsObject > object, size_t i, Handle< JsValue > value)
 
void SetGenericPropertyRaw (Handle< JsObject > object, const std::string &name, Handle< JsFunction > getter, Handle< JsFunction > setter)
 
bool InvokeConstructor (Handle< JsFunction > ctor, int argc, LocalVar< JsValue > *argv, LocalVar< JsValue > *result_or_except)
 
bool InvokeMethod (Handle< JsFunction > method, Handle< JsObject > that, int argc, LocalVar< JsValue > *argv, LocalVar< JsValue > *result_or_except)
 
std::string ConvertToString (Handle< JsValue > value)
 
ReturnVal< JsValue > WrapPointer (void *ptr)
 
void * MaybeUnwrapPointer (Handle< JsValue > value)
 
BackingObjectGetInternalPointer (Handle< JsValue > value)
 
bool IsDerivedFrom (BackingObject *ptr, const std::string &name)
 
bool RunScript (const std::string &path)
 
bool RunScript (const std::string &path, const uint8_t *data, size_t data_size)
 
ReturnVal< JsValue > ParseJsonString (const std::string &json)
 
ReturnVal< JsString > JsStringFromUtf8 (const std::string &str)
 
ReturnVal< JsString > JsStringFromUtf8 (const uint8_t *data, size_t size)
 
ReturnVal< JsValue > JsUndefined ()
 
ReturnVal< JsValue > JsNull ()
 
ReturnVal< JsObject > CreateArray (size_t length)
 
ReturnVal< JsObject > CreateObject ()
 
ReturnVal< JsMap > CreateMap ()
 
void SetMapValue (Handle< JsMap > map, Handle< JsValue > key, Handle< JsValue > value)
 
bool IsNullOrUndefined (Handle< JsValue > value)
 
bool IsObject (Handle< JsValue > value)
 
bool IsBuiltInObject (Handle< JsObject > object)
 
proto::ValueType GetValueType (Handle< JsValue > value)
 
size_t ArrayLength (Handle< JsObject > value)
 
double NumberFromValue (Handle< JsValue > value)
 
bool BooleanFromValue (Handle< JsValue > value)
 
JSContextRef GetContext ()
 
void OnUncaughtException (JSValueRef exception, bool in_promise)
 
JSValueRef CreateNativeObject (const std::string &name, JSValueRef *args, size_t argc)
 
template<typename Func >
ReturnVal< JsFunction > CreateStaticFunction (const std::string &target, const std::string &name, Func &&callback)
 
template<typename Func >
ReturnVal< JsFunction > CreateMemberFunction (const std::string &target, const std::string &name, Func &&callback)
 
template<typename Func >
void RegisterGlobalFunction (const std::string &name, Func &&callback)
 
v8::Isolate * GetIsolate ()
 
void PrintStackTrace (const v8::Local< v8::StackTrace > &stack)
 
void OnUncaughtException (const v8::Local< v8::Value > &exception, bool in_promise)
 
bool IsTrue (const v8::Maybe< bool > &value)
 
template<typename Dest >
ReturnVal< Dest > UnsafeJsCast (Handle< JsValue > source)
 
template<typename T >
ReturnVal< JsValue > RawToJsValue (Handle< T > source)
 

Variables

const nullopt_t nullopt = nullopt_t(0)
 
const DefaultValueType DefaultValue
 

Typedef Documentation

§ variant_alternative_t

template<size_t I, typename Variant >
using shaka::variant_alternative_t = typedef typename variant_alternative<I, Variant>::type

Definition at line 288 of file variant.h.

Enumeration Type Documentation

§ ExceptionCode

Enumerator
IndexSizeError 
HierarchyRequestError 
WrongDocumentError 
InvalidCharacterError 
NoModificationAllowedError 
NotFoundError 
NotSupportedError 
InUseAttributeError 
InvalidStateError 
SyntaxError 
InvalidModificationError 
NamespaceError 
InvalidAccessError 
TypeMismatchError 
SecurityError 
NetworkError 
AbortError 
URLMismatchError 
QuotaExceededError 
TimeoutError 
InvalidNodeTypeError 
DataCloneError 
EncodingError 
NotReadableError 
UnknownError 
ConstraintError 
DataError 
TransactionInactiveError 
ReadOnlyError 
VersionError 
OperationError 
NotAllowedError 
MaxExceptionCode 

Definition at line 22 of file exception_code.h.

§ RequestType

enum shaka::RequestType : int8_t
strong

The type of request being made. See shaka.net.NetworkingEngine.RequestType.

Enumerator
Unknown 
Manifest 
Segment 
License 
App 
Timing 

Definition at line 38 of file net.h.

§ TaskPriority

enum shaka::TaskPriority
strong
Enumerator
Timer 
Internal 
Events 
Immediate 

Definition at line 37 of file task_runner.h.

Function Documentation

§ ArgumentCount()

size_t shaka::ArgumentCount ( const CallbackArguments &  arguments)
inline

This defines several types that are used to represent JavaScript values.

Handle<T> represents a handle to a JavaScript value. LocalVar<T> represents a local variable that holds a JavaScript value. ReturnVal<T> is a JavaScript value that is returned from a C++ function. This is NOT a Handle<T>.

For compatibility, you should not pass a ReturnVal<T> as an argument. Store it in a LocalVar<T> first before passing. Also, different types should be incompatible with each other (i.e. a JsString is not a JsValue).

Returns
The number of arguments that were given.

Definition at line 209 of file js_wrappers.h.

§ ArrayLength()

size_t shaka::ArrayLength ( Handle< JsObject >  value)
inline

Definition at line 418 of file js_wrappers.h.

§ BooleanFromValue()

bool shaka::BooleanFromValue ( Handle< JsValue >  value)
Returns
The primitive boolean from the given JavaScript boolean. This must be a primitive boolean or a boolean object.

Definition at line 394 of file js_wrappers.cc.

§ ConvertToString()

std::string shaka::ConvertToString ( Handle< JsValue >  value)
Returns
The given value converted to a string.

Definition at line 203 of file js_wrappers.cc.

§ CreateArray()

ReturnVal< JsObject > shaka::CreateArray ( size_t  length)
Returns
A new JavaScript array object.

Definition at line 292 of file js_wrappers.cc.

§ CreateMap()

ReturnVal< JsMap > shaka::CreateMap ( )
Returns
A new JavaScript Map object.

Definition at line 300 of file js_wrappers.cc.

§ CreateMemberFunction()

template<typename Func >
ReturnVal<JsFunction> shaka::CreateMemberFunction ( const std::string &  target,
const std::string &  name,
Func &&  callback 
)
See also
CreateStaticFunction The first argument given to the callback will be the |this| argument from JavaScript. It should be a RefPtr<T> of an appropriate type.

Definition at line 617 of file register_member.h.

§ CreateNativeObject()

JSValueRef shaka::CreateNativeObject ( const std::string &  name,
JSValueRef *  args,
size_t  argc 
)

Definition at line 40 of file jsc_utils.cc.

§ CreateObject()

ReturnVal< JsObject > shaka::CreateObject ( )
Returns
A new plain JavaScript object.

Definition at line 296 of file js_wrappers.cc.

§ CreateStaticFunction()

template<typename Func >
ReturnVal<JsFunction> shaka::CreateStaticFunction ( const std::string &  target,
const std::string &  name,
Func &&  callback 
)

Creates a new JavaScript function object that will call the given C++ callback when it is called. This will convert the JavaScript arguments into their C++ values and throw JavaScript errors if there are invalid arguments. This callback can throw an instance of JsError to be converted to a JavaScript exception. The callback will be invoked on the event thread.

Parameters
targetThe name of the |this| object, used for exception messages.
nameThe name of the function, used for exception messages.
callbackThe callback to invoke.
Returns
The resulting function object.

Definition at line 604 of file register_member.h.

§ FromJsValue()

template<typename T >
bool shaka::FromJsValue ( Handle< JsValue >  source,
T *  dest 
)

Tries to convert the given JavaScript value to the given type.

Parameters
sourceThe JavaScript object to convert.
dest[OUT] Where to put the converted value, not changed if there is an error.
Returns
True on success, false on error.

Definition at line 370 of file convert_js.h.

§ get() [1/5]

template<size_t I, typename... Choices>
impl::get_const_reference_at_t<I, Choices...> shaka::get ( const variant< Choices... > &  variant)

Definition at line 456 of file variant.h.

§ get() [2/5]

template<size_t I, typename... Choices>
variant_alternative_t<I, variant<Choices...> >& shaka::get ( variant< Choices... > &  variant)

Definition at line 462 of file variant.h.

§ get() [3/5]

template<typename T , typename... Choices>
const T& shaka::get ( const variant< Choices... > &  variant)

Definition at line 468 of file variant.h.

§ get() [4/5]

template<typename T , typename... Choices>
T& shaka::get ( variant< Choices... > &  variant)

Definition at line 474 of file variant.h.

§ get() [5/5]

template<typename T , typename... Choices>
T&& shaka::get ( variant< Choices... > &&  variant)

Definition at line 480 of file variant.h.

§ get_if() [1/4]

template<size_t I, typename... Choices>
std::add_const<variant_alternative_t<I, variant<Choices...> > >::type* shaka::get_if ( const variant< Choices... > &  variant)

Definition at line 488 of file variant.h.

§ get_if() [2/4]

template<size_t I, typename... Choices>
variant_alternative_t<I, variant<Choices...> >* shaka::get_if ( variant< Choices... > &  variant)

Definition at line 496 of file variant.h.

§ get_if() [3/4]

template<typename T , typename... Choices>
const T* shaka::get_if ( const variant< Choices... > &  variant)

Definition at line 505 of file variant.h.

§ get_if() [4/4]

template<typename T , typename... Choices>
T* shaka::get_if ( variant< Choices... > &  variant)

Definition at line 514 of file variant.h.

§ GetArrayIndexRaw()

ReturnVal< JsValue > shaka::GetArrayIndexRaw ( Handle< JsObject >  object,
size_t  index,
LocalVar< JsValue > *  exception = nullptr 
)
Returns
The member at the given index of the given object.

Definition at line 142 of file js_wrappers.cc.

§ GetContext()

JSContextRef shaka::GetContext ( )

Definition at line 24 of file jsc_utils.cc.

§ GetDescendant()

ReturnVal< JsValue > shaka::GetDescendant ( Handle< JsObject >  root,
const std::vector< std::string > &  names 
)

Traverses a namespace/object structure to get a descendant member. This will repeatedly get the child of the current object with a name from names, starting at root. This will return an empty value if one of the children isn't found or isn't an object.

Parameters
rootThe object to start traversing at.
namesThe member names to traverse with.
Returns
The descendant at the given path, or an empty value if not found.

Definition at line 52 of file js_utils.cc.

§ GetInternalPointer()

BackingObject * shaka::GetInternalPointer ( Handle< JsValue >  value)
Returns
The internal pointer for the given value, or nullptr if it is not a backing object.

Definition at line 223 of file js_wrappers.cc.

§ GetIsolate()

v8::Isolate * shaka::GetIsolate ( )

Gets the current Isolate instance, checking that we are in a valid state. V8 must be ready first, meaning that this must be the event thread or we are being initialized (event loop is stopped).

Definition at line 27 of file v8_utils.cc.

§ GetMemberNames()

std::vector< std::string > shaka::GetMemberNames ( Handle< JsObject >  object)

Get the properties of the current object. This will only return the properties on 'this' and not on the prototype.

Parameters
objectThe object of interest.
Returns
The member names found in the given object.

Definition at line 118 of file js_wrappers.cc.

§ GetMemberRaw()

ReturnVal< JsValue > shaka::GetMemberRaw ( Handle< JsObject >  object,
const std::string &  name,
LocalVar< JsValue > *  exception = nullptr 
)
Returns
The given member of the given object.

Definition at line 136 of file js_wrappers.cc.

§ GetValueType()

proto::ValueType shaka::GetValueType ( Handle< JsValue >  value)
Returns
The type of value contained.

Definition at line 329 of file js_wrappers.cc.

§ HandleNetworkFuture()

void shaka::HandleNetworkFuture ( Promise  promise,
std::future< optional< Error >>  future,
std::function< void()>  on_done 
)

Handles watching the given future to finish, reports any errors to the promise, and calls the given callback when (and if) the future resolves with success. The callback will always be invoked on the JS main thread.

Definition at line 68 of file js_utils.cc.

§ holds_alternative()

template<typename T , typename... Choices>
bool shaka::holds_alternative ( const variant< Choices... > &  variant)

Definition at line 449 of file variant.h.

§ InvokeConstructor()

bool shaka::InvokeConstructor ( Handle< JsFunction >  ctor,
int  argc,
LocalVar< JsValue > *  argv,
LocalVar< JsValue > *  result_or_except 
)

Calls the given function as a constructor and gives the resulting object or the exception that was thrown.

Parameters
ctorThe constructor to call.
argcThe number of arguments to pass in.
argvThe array of arguments to pass in.
result_or_except[OUT] Will contain the resulting object or the exception that was thrown.
Returns
True if the constructor returned an object, false if it threw an exception.

Definition at line 165 of file js_wrappers.cc.

§ InvokeMethod()

bool shaka::InvokeMethod ( Handle< JsFunction >  method,
Handle< JsObject >  that,
int  argc,
LocalVar< JsValue > *  argv,
LocalVar< JsValue > *  result_or_except 
)

Calls the given function and gives the resulting return value or the exception that was thrown.

Parameters
methodThe method to call.
thatThe value that should be |this| in the call.
argcThe number of arguments to pass in.
argvThe array of arguments to pass in.
result_or_except[OUT] Will contain the resulting object or the exception that was thrown.
Returns
True if the function returned an object, false if it threw an exception.

Definition at line 182 of file js_wrappers.cc.

§ IsBuiltInObject()

bool shaka::IsBuiltInObject ( Handle< JsObject >  object)
Returns
Whether the given object is an instance of a built-in type. This includes both JavaScript-defined types like ArrayBuffer and types defined by BackingObjects.

Definition at line 319 of file js_wrappers.cc.

§ IsDerivedFrom()

bool shaka::IsDerivedFrom ( BackingObject ptr,
const std::string &  name 
)

Gets whether the given object derives from the given type name. This exists so RefPtr<T> can check this without needing the BackingObject header.

Definition at line 235 of file js_wrappers.cc.

§ IsNullOrUndefined()

bool shaka::IsNullOrUndefined ( Handle< JsValue >  value)
Returns
Whether the given value is |null| or |undefined|.

Definition at line 311 of file js_wrappers.cc.

§ IsObject()

bool shaka::IsObject ( Handle< JsValue >  value)
Returns
Whether the given value is an object. Unlike typeof, this will return false for |null|.

Definition at line 315 of file js_wrappers.cc.

§ IsTrue()

bool shaka::IsTrue ( const v8::Maybe< bool > &  value)
inline
Returns
Wether the value is the value |true|.

Definition at line 32 of file v8_utils.h.

§ JsNull()

ReturnVal< JsValue > shaka::JsNull ( )
Returns
The JavaScript value |null|.

Definition at line 288 of file js_wrappers.cc.

§ JsStringFromUtf8() [1/2]

ReturnVal< JsString > shaka::JsStringFromUtf8 ( const std::string &  str)
Returns
A new string object containing the given UTF-8 string.

Definition at line 266 of file js_wrappers.cc.

§ JsStringFromUtf8() [2/2]

ReturnVal< JsString > shaka::JsStringFromUtf8 ( const uint8_t *  data,
size_t  size 
)
Returns
A new string object containing the given UTF-8 string in bytes.

Definition at line 277 of file js_wrappers.cc.

§ JsUndefined()

ReturnVal< JsValue > shaka::JsUndefined ( )
Returns
The JavaScript value |undefined|.

Definition at line 284 of file js_wrappers.cc.

§ MainThreadCallback()

template<typename... Args>
std::function<void(Args...)> shaka::MainThreadCallback ( std::function< void(Args...)>  cb)

Creates a callback that, when invoked, will invoke the given callback on the main thread.

Definition at line 87 of file js_manager_impl.h.

§ MakeJsRef()

template<typename T , typename... Args>
RefPtr<T> shaka::MakeJsRef ( Args &&...  args)

Allocates a new heap object of the given type that is managed by the ObjectTracker. This allows non-Backing objects (e.g. Callback) to be managed using RefPtr<T>.

Definition at line 52 of file js_utils.h.

§ MaybeUnwrapPointer()

void * shaka::MaybeUnwrapPointer ( Handle< JsValue >  value)
Returns
The pointer the given value wraps, or nullptr if not a wrapped pointer.

Definition at line 217 of file js_wrappers.cc.

§ NumberFromValue()

double shaka::NumberFromValue ( Handle< JsValue >  value)
Returns
The primitive number from the given JavaScript number. This must be a primitive number or a number object.

Definition at line 385 of file js_wrappers.cc.

§ OnUncaughtException() [1/2]

void shaka::OnUncaughtException ( JSValueRef  exception,
bool  in_promise 
)

Definition at line 28 of file jsc_utils.cc.

§ OnUncaughtException() [2/2]

void shaka::OnUncaughtException ( const v8::Local< v8::Value > &  exception,
bool  in_promise 
)

Called when an uncaught exception occurs. Prints information about the given exception.

Definition at line 47 of file v8_utils.cc.

§ operator!=() [1/7]

bool shaka::operator!= ( const ByteBuffer lhs,
const ByteBuffer rhs 
)
inline

Definition at line 112 of file byte_buffer.h.

§ operator!=() [2/7]

template<class A , class B >
bool shaka::operator!= ( const optional< A > &  lhs,
const optional< B > &  rhs 
)

Definition at line 214 of file optional.h.

§ operator!=() [3/7]

template<class T >
bool shaka::operator!= ( const optional< T > &  opt,
nullopt_t   
)

Definition at line 246 of file optional.h.

§ operator!=() [4/7]

template<class T >
bool shaka::operator!= ( nullopt_t  ,
const optional< T > &  opt 
)

Definition at line 250 of file optional.h.

§ operator!=() [5/7]

template<class A , class B >
bool shaka::operator!= ( const optional< A > &  opt,
const B &  value 
)

Definition at line 295 of file optional.h.

§ operator!=() [6/7]

template<class A , class B >
bool shaka::operator!= ( const A &  value,
const optional< B > &  opt 
)

Definition at line 299 of file optional.h.

§ operator!=() [7/7]

template<typename... Choices>
bool shaka::operator!= ( const variant< Choices... > &  lhs,
const variant< Choices... > &  rhs 
)

Definition at line 442 of file variant.h.

§ operator<() [1/5]

template<class A , class B >
bool shaka::operator< ( const optional< A > &  lhs,
const optional< B > &  rhs 
)

Definition at line 218 of file optional.h.

§ operator<() [2/5]

template<class T >
bool shaka::operator< ( const optional< T > &  opt,
nullopt_t   
)

Definition at line 254 of file optional.h.

§ operator<() [3/5]

template<class T >
bool shaka::operator< ( nullopt_t  ,
const optional< T > &  opt 
)

Definition at line 258 of file optional.h.

§ operator<() [4/5]

template<class A , class B >
bool shaka::operator< ( const optional< A > &  opt,
const B &  value 
)

Definition at line 303 of file optional.h.

§ operator<() [5/5]

template<class A , class B >
bool shaka::operator< ( const A &  value,
const optional< B > &  opt 
)

Definition at line 307 of file optional.h.

§ operator<<() [1/2]

std::ostream& shaka::operator<< ( std::ostream &  os,
const Error error 
)
inline

Definition at line 75 of file error.h.

§ operator<<() [2/2]

template<typename T >
std::ostream& shaka::operator<< ( std::ostream &  os,
RefPtr< T >  arg 
)

Definition at line 148 of file ref_ptr.h.

§ operator<=() [1/5]

template<class A , class B >
bool shaka::operator<= ( const optional< A > &  lhs,
const optional< B > &  rhs 
)

Definition at line 225 of file optional.h.

§ operator<=() [2/5]

template<class T >
bool shaka::operator<= ( const optional< T > &  opt,
nullopt_t   
)

Definition at line 262 of file optional.h.

§ operator<=() [3/5]

template<class T >
bool shaka::operator<= ( nullopt_t  ,
const optional< T > &  opt 
)

Definition at line 266 of file optional.h.

§ operator<=() [4/5]

template<class A , class B >
bool shaka::operator<= ( const optional< A > &  opt,
const B &  value 
)

Definition at line 311 of file optional.h.

§ operator<=() [5/5]

template<class A , class B >
bool shaka::operator<= ( const A &  value,
const optional< B > &  opt 
)

Definition at line 315 of file optional.h.

§ operator==() [1/7]

bool shaka::operator== ( const ByteBuffer lhs,
const ByteBuffer rhs 
)
inline

Definition at line 108 of file byte_buffer.h.

§ operator==() [2/7]

template<class A , class B >
bool shaka::operator== ( const optional< A > &  lhs,
const optional< B > &  rhs 
)

Definition at line 207 of file optional.h.

§ operator==() [3/7]

template<class T >
bool shaka::operator== ( const optional< T > &  opt,
nullopt_t   
)

Definition at line 238 of file optional.h.

§ operator==() [4/7]

template<class T >
bool shaka::operator== ( nullopt_t  ,
const optional< T > &  opt 
)

Definition at line 242 of file optional.h.

§ operator==() [5/7]

template<class A , class B >
bool shaka::operator== ( const optional< A > &  opt,
const B &  value 
)

Definition at line 287 of file optional.h.

§ operator==() [6/7]

template<class A , class B >
bool shaka::operator== ( const A &  value,
const optional< B > &  opt 
)

Definition at line 291 of file optional.h.

§ operator==() [7/7]

template<typename... Choices>
bool shaka::operator== ( const variant< Choices... > &  lhs,
const variant< Choices... > &  rhs 
)

Definition at line 436 of file variant.h.

§ operator>() [1/5]

template<class A , class B >
bool shaka::operator> ( const optional< A > &  lhs,
const optional< B > &  rhs 
)

Definition at line 229 of file optional.h.

§ operator>() [2/5]

template<class T >
bool shaka::operator> ( const optional< T > &  opt,
nullopt_t   
)

Definition at line 270 of file optional.h.

§ operator>() [3/5]

template<class T >
bool shaka::operator> ( nullopt_t  ,
const optional< T > &  opt 
)

Definition at line 274 of file optional.h.

§ operator>() [4/5]

template<class A , class B >
bool shaka::operator> ( const optional< A > &  opt,
const B &  value 
)

Definition at line 319 of file optional.h.

§ operator>() [5/5]

template<class A , class B >
bool shaka::operator> ( const A &  value,
const optional< B > &  opt 
)

Definition at line 323 of file optional.h.

§ operator>=() [1/5]

template<class A , class B >
bool shaka::operator>= ( const optional< A > &  lhs,
const optional< B > &  rhs 
)

Definition at line 233 of file optional.h.

§ operator>=() [2/5]

template<class T >
bool shaka::operator>= ( const optional< T > &  opt,
nullopt_t   
)

Definition at line 278 of file optional.h.

§ operator>=() [3/5]

template<class T >
bool shaka::operator>= ( nullopt_t  ,
const optional< T > &  opt 
)

Definition at line 282 of file optional.h.

§ operator>=() [4/5]

template<class A , class B >
bool shaka::operator>= ( const optional< A > &  opt,
const B &  value 
)

Definition at line 327 of file optional.h.

§ operator>=() [5/5]

template<class A , class B >
bool shaka::operator>= ( const A &  value,
const optional< B > &  opt 
)

Definition at line 331 of file optional.h.

§ ParseJsonString()

ReturnVal< JsValue > shaka::ParseJsonString ( const std::string &  json)

Parses the given string as JSON and returns the given value.

Parameters
jsonThe input string.
Returns
The resulting JavaScrpt value, or nullptr on error.

Definition at line 256 of file js_wrappers.cc.

§ PrintStackTrace()

void shaka::PrintStackTrace ( const v8::Local< v8::StackTrace > &  stack)

Prints the given stack trace to stderr.

Definition at line 31 of file v8_utils.cc.

§ RawToJsValue()

template<typename T >
ReturnVal<JsValue> shaka::RawToJsValue ( Handle< T >  source)

Converts the given value, object, or string into a value type.

Definition at line 405 of file js_wrappers.h.

§ RegisterDefaultKeySystems()

void shaka::RegisterDefaultKeySystems ( )

§ RegisterGlobalFunction()

template<typename Func >
void shaka::RegisterGlobalFunction ( const std::string &  name,
Func &&  callback 
)

Registers a static function on the global object. This is a static function and will ignore |this|.

Parameters
nameThe name of the function (used for errors).
callbackThe callback function to call.

Definition at line 632 of file register_member.h.

§ RunScript() [1/2]

bool shaka::RunScript ( const std::string &  path)

Reads a JavaScript file from the given path and executes it in the current isolate.

Parameters
pathThe file path to the JavaScript file.

Definition at line 239 of file js_wrappers.cc.

§ RunScript() [2/2]

bool shaka::RunScript ( const std::string &  path,
const uint8_t *  data,
size_t  data_size 
)

Executes the given JavaScript code in the current isolate.

Parameters
pathThe file path to the JavaScript file. This is only used for logging.
dataThe contents of the file.
data_sizeThe number of bytes in |data|.

Definition at line 251 of file js_wrappers.cc.

§ SetArrayIndexRaw()

void shaka::SetArrayIndexRaw ( Handle< JsObject >  object,
size_t  i,
Handle< JsValue >  value 
)

Sets the member at the given index of the given object.

Definition at line 152 of file js_wrappers.cc.

§ SetGenericPropertyRaw()

void shaka::SetGenericPropertyRaw ( Handle< JsObject >  object,
const std::string &  name,
Handle< JsFunction >  getter,
Handle< JsFunction >  setter 
)

Adds a generic property on the given object.

Definition at line 158 of file js_wrappers.cc.

§ SetMapValue()

void shaka::SetMapValue ( Handle< JsMap >  map,
Handle< JsValue >  key,
Handle< JsValue >  value 
)

Sets the value of the given key in the given map. This is not the same as SetMemberRaw.

Definition at line 304 of file js_wrappers.cc.

§ SetMemberRaw()

void shaka::SetMemberRaw ( Handle< JsObject >  object,
const std::string &  name,
Handle< JsValue >  value 
)

Sets the given member on the given object.

Definition at line 147 of file js_wrappers.cc.

§ ToJsValue()

template<typename T >
ReturnVal<JsValue> shaka::ToJsValue ( T &&  source)

Converts the given C++ object to a JavaScript value.

Parameters
sourceThe C++ object to convert.
Returns
A new JavaScript value.

Definition at line 381 of file convert_js.h.

§ UnsafeJsCast()

template<typename Dest >
ReturnVal<Dest> shaka::UnsafeJsCast ( Handle< JsValue >  source)

Converts the given value to a different type. This only performs debug assertions that the type is correct, the caller should check the type beforehand (e.g. by using GetValueType).

Definition at line 382 of file js_wrappers.h.

§ WrapPointer()

ReturnVal< JsValue > shaka::WrapPointer ( void *  ptr)
Returns
A new JavaScript object that wraps the given pointer.

Definition at line 213 of file js_wrappers.cc.

Variable Documentation

§ nullopt

BEGIN_ALLOW_COMPLEX_STATICS const nullopt_t shaka::nullopt = nullopt_t(0)

Definition at line 22 of file optional.cc.