This section describes the Tizen WASM Video Decoder sample application and how to use it.
The Tizen WASM Video Decoder sample application shows how to use Tizen WASM Video Decoder to play media on a Samsung device using a WebAssembly module. This application is an extension to the Tizen WASM Player Sample Application. It illustrates how to extend an existing WASM Player application to achieve decoding video frames to GL texture functionality. The emss_sdf_sample.h and emss_sdf_sample.cc files have been copied from the wasm_player_sample application and are used only to manage playback in media player. Video Decoder logic is located in the video_decoder_sdf_sample.h and video_decoder_sdf_sample.cc files. The sample application's features are:
emss_sdf_sample.h
emss_sdf_sample.cc
wasm_player_sample
video_decoder_sdf_sample.h
video_decoder_sdf_sample.cc
HTMLMediaElement
ElementaryMediaStreamSource
kVideoTexture
Packetized data is hardcoded in the application to maximize data access simplicity.
This section covers how to build the sample widget in Tizen Studio, including prerequisites and a step by step guide to the build process.
To build the sample application, you need the following:
To build the sample application:
VideoDecoderSample
VideoDecoderSampleModule
VideoDecoderSample/index.html
VideoDecoderSample/main.js
VideoDecoderSample/css/style.css
VideoDecoderSampleModule/inc/empty.hpp
VideoDecoderSampleModule/src/empty.cpp
elementary_media_stream_source_sample/widget/*
VideoDecoderSample/
elementary_media_stream_source_sample/src/*
VideoDecoderSampleModule/
-std=gnu++11
-std=gnu++14
-s ENVIRONMENT_MAY_BE_TIZEN -pthread -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1
-s EXPORT_NAME=EMSSSampleModule -s MODULARIZE=1
MODULARIZE
The application is ready to use!
The table below explains Emscripten-specific build flags required to build this sample:
-s ENVIRONMENT_MAY_BE_TIZEN
-pthread -s USE_PTHREADS=1
-s PTHREAD_POOL_SIZE=1
Table 1. Required Samsung Emscripten SDK Flags