summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-08-26 18:28:43 +0300
committerSebastian Dröge <sebastian@centricular.com>2016-08-26 18:28:43 +0300
commit7b9b4b15da34c93f9b42c090bc3bdda371b7148a (patch)
tree376666a6ab386cc2aa9a45747a2790967d076c07
parent3e67a2315c10ed63e73585c112d14e257d4ded05 (diff)
parentf6cf0dd99701be7f3632c3e7c99c65eb404df018 (diff)
Merge commit 'gst-player/merge'
All gst-player example applications from https://github.com/sdroege/gst-player
-rw-r--r--playback/player/android/Makefile.am15
-rw-r--r--playback/player/android/app/build.gradle73
-rw-r--r--playback/player/android/app/proguard-rules.pro17
-rw-r--r--playback/player/android/app/src/main/AndroidManifest.xml344
-rw-r--r--playback/player/android/app/src/main/java/org/freedesktop/gstreamer/Player.java241
-rw-r--r--playback/player/android/app/src/main/java/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java110
-rw-r--r--playback/player/android/app/src/main/java/org/freedesktop/gstreamer/player/Play.java196
-rw-r--r--playback/player/android/app/src/main/jni/Android.mk39
-rw-r--r--playback/player/android/app/src/main/jni/Application.mk1
-rw-r--r--playback/player/android/app/src/main/jni/player.c497
-rw-r--r--playback/player/android/app/src/main/res/layout/main.xml62
-rw-r--r--playback/player/android/app/src/main/res/values/strings.xml6
-rw-r--r--playback/player/android/build.gradle23
-rw-r--r--playback/player/android/gradle.properties18
-rw-r--r--playback/player/android/gradle/wrapper/gradle-wrapper.jarbin0 -> 53637 bytes
-rw-r--r--playback/player/android/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xplayback/player/android/gradlew160
-rw-r--r--playback/player/android/gradlew.bat90
-rw-r--r--playback/player/android/settings.gradle1
-rw-r--r--playback/player/gst-play/Makefile.am9
-rw-r--r--playback/player/gst-play/gst-play-kb.c143
-rw-r--r--playback/player/gst-play/gst-play-kb.h35
-rw-r--r--playback/player/gst-play/gst-play.c773
-rw-r--r--playback/player/gtk/Makefile.am35
-rw-r--r--playback/player/gtk/gtk-play.c1918
-rw-r--r--playback/player/gtk/gtk-video-renderer.c178
-rw-r--r--playback/player/gtk/gtk-video-renderer.h49
-rw-r--r--playback/player/gtk/resources/gresources.xml11
-rw-r--r--playback/player/gtk/resources/media_info_dialog.ui108
-rw-r--r--playback/player/gtk/resources/toolbar.css26
-rw-r--r--playback/player/gtk/resources/toolbar.ui341
-rw-r--r--playback/player/ios/GstPlay.xcodeproj/project.pbxproj422
-rw-r--r--playback/player/ios/GstPlay.xcodeproj/project.xcworkspace/contents.xcworkspacedata7
-rw-r--r--playback/player/ios/GstPlay.xcodeproj/xcuserdata/slomo.xcuserdatad/xcschemes/GstPlay.xcscheme96
-rw-r--r--playback/player/ios/GstPlay.xcodeproj/xcuserdata/slomo.xcuserdatad/xcschemes/xcschememanagement.plist27
-rw-r--r--playback/player/ios/GstPlay/AppDelegate.h15
-rw-r--r--playback/player/ios/GstPlay/AppDelegate.m45
-rw-r--r--playback/player/ios/GstPlay/EaglUIVIew.h11
-rw-r--r--playback/player/ios/GstPlay/EaglUIVIew.m13
-rw-r--r--playback/player/ios/GstPlay/GstPlay-Info.plist49
-rw-r--r--playback/player/ios/GstPlay/GstPlay-Prefix.pch16
-rw-r--r--playback/player/ios/GstPlay/LibraryViewController.h12
-rw-r--r--playback/player/ios/GstPlay/LibraryViewController.m136
-rw-r--r--playback/player/ios/GstPlay/MainStoryboard_iPad.storyboard180
-rw-r--r--playback/player/ios/GstPlay/MainStoryboard_iPhone.storyboard185
-rw-r--r--playback/player/ios/GstPlay/OnlineMedia.plist30
-rw-r--r--playback/player/ios/GstPlay/Ubuntu-R.ttfbin0 -> 353824 bytes
-rw-r--r--playback/player/ios/GstPlay/VideoViewController.h23
-rw-r--r--playback/player/ios/GstPlay/VideoViewController.m205
-rw-r--r--playback/player/ios/GstPlay/en.lproj/InfoPlist.strings2
-rw-r--r--playback/player/ios/GstPlay/fonts.conf126
-rw-r--r--playback/player/ios/GstPlay/gst_ios_init.h39
-rw-r--r--playback/player/ios/GstPlay/gst_ios_init.m1054
-rw-r--r--playback/player/ios/GstPlay/main.m12
-rw-r--r--playback/player/ios/Makefile.am22
-rw-r--r--playback/player/qt/deployment.pri27
-rw-r--r--playback/player/qt/fontawesome-webfont.ttfbin0 -> 122092 bytes
-rw-r--r--playback/player/qt/fontawesome-webfont.ttf.txt10
-rw-r--r--playback/player/qt/fontawesome.js214
-rw-r--r--playback/player/qt/imagesample.cpp61
-rw-r--r--playback/player/qt/imagesample.h46
-rw-r--r--playback/player/qt/main.cpp78
-rw-r--r--playback/player/qt/main.qml732
-rw-r--r--playback/player/qt/play.pro48
-rw-r--r--playback/player/qt/player.cpp41
-rw-r--r--playback/player/qt/player.h44
-rw-r--r--playback/player/qt/qgstplayer.cpp967
-rw-r--r--playback/player/qt/qgstplayer.h316
-rw-r--r--playback/player/qt/qml.qrc9
-rw-r--r--playback/player/qt/quickrenderer.cpp56
-rw-r--r--playback/player/qt/quickrenderer.h42
71 files changed, 10943 insertions, 0 deletions
diff --git a/playback/player/android/Makefile.am b/playback/player/android/Makefile.am
new file mode 100644
index 0000000..27d8ada
--- /dev/null
+++ b/playback/player/android/Makefile.am
@@ -0,0 +1,15 @@
+EXTRA_DIST = \
+ build.gradle \
+ gradle.properties \
+ settings.gradle \
+ app/build.gradle \
+ app/proguard-rules.pro \
+ app/src/main/AndroidManifest.xml \
+ app/src/main/java/org/freedesktop/gstreamer/Player.java \
+ app/src/main/java/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java \
+ app/src/main/java/org/freedesktop/gstreamer/player/Play.java \
+ app/src/main/jni/Android.mk \
+ app/src/main/jni/Application.mk \
+ app/src/main/jni/player.c \
+ app/src/main/res/layout/main.xml \
+ app/src/main/res/values/strings.xml
diff --git a/playback/player/android/app/build.gradle b/playback/player/android/app/build.gradle
new file mode 100644
index 0000000..50b135e
--- /dev/null
+++ b/playback/player/android/app/build.gradle
@@ -0,0 +1,73 @@
+apply plugin: 'com.android.application'
+
+
+def getNdkCommandLine(ndkRoot, target) {
+ def gstRoot
+
+ if (project.hasProperty('gstAndroidRoot'))
+ gstRoot = project.gstAndroidRoot
+ else
+ gstRoot = System.properties['user.home'] + '/cerbero/dist/android_arm'
+
+ if (ndkRoot == null)
+ throw new GradleException('NDK not configured')
+
+ return ["$ndkRoot/ndk-build",
+ 'NDK_PROJECT_PATH=build',
+ 'APP_BUILD_SCRIPT=src/main/jni/Android.mk',
+ 'NDK_APPLICATION_MK=src/main/jni/Application.mk',
+ 'GSTREAMER_JAVA_SRC_DIR=src/main/java',
+ "GSTREAMER_ROOT_ANDROID=$gstRoot",
+ target]
+}
+
+android {
+ compileSdkVersion 23
+ buildToolsVersion "23.0.3"
+
+ sourceSets {
+ main {
+ // Avoid using the built in JNI generation plugin
+ jni.srcDirs = []
+ jniLibs.srcDirs = ['build/libs']
+ }
+ }
+
+ defaultConfig {
+ applicationId "org.freedesktop.gstreamer.play"
+ minSdkVersion 15
+ targetSdkVersion 15
+ versionCode 1
+ versionName "1.0"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ // Before compiling our app, prepare NDK code
+ tasks.withType(JavaCompile) {
+ compileTask -> compileTask.dependsOn ndkBuild
+ }
+
+ // Need to call clean on NDK ourselves too
+ clean.dependsOn 'ndkClean'
+
+ // Build native code using mk files like on Eclipse
+ task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {
+ commandLine getNdkCommandLine(android.ndkDirectory, 'all')
+ }
+
+ task ndkClean(type: Exec, description: 'Clean JNI code built via NDK') {
+ commandLine getNdkCommandLine(android.ndkDirectory, 'clean')
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ testCompile 'junit:junit:4.12'
+ compile 'com.android.support:appcompat-v7:23.1.1'
+}
diff --git a/playback/player/android/app/proguard-rules.pro b/playback/player/android/app/proguard-rules.pro
new file mode 100644
index 0000000..d5d45de
--- /dev/null
+++ b/playback/player/android/app/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /home/arun/code/android/sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/playback/player/android/app/src/main/AndroidManifest.xml b/playback/player/android/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..9823f22
--- /dev/null
+++ b/playback/player/android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,344 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.freedesktop.gstreamer.play">
+
+ <uses-permission android:name="android.permission.INTERNET"/>
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+ <uses-permission android:name="android.permission.WAKE_LOCK"/>
+ <uses-feature android:glEsVersion="0x00020000"/>
+
+ <application android:label="@string/app_name">
+ <activity android:name=".Play"
+ android:label="@string/app_name">
+ <!-- Files whose MIME type is known to Android -->
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+
+ <data android:mimeType="audio/*" />
+ <data android:mimeType="video/*" />
+ <data android:mimeType="image/*" />
+ <data android:mimeType="*/rmvb" />
+ <data android:mimeType="*/avi" />
+ <data android:mimeType="*/mkv" />
+ <data android:mimeType="application/3gpp*" />
+ <data android:mimeType="application/mp4" />
+ <data android:mimeType="application/mpeg*" />
+ <data android:mimeType="application/ogg" />
+ <data android:mimeType="application/sdp" />
+ <data android:mimeType="application/vnd.3gp*" />
+ <data android:mimeType="application/vnd.apple.mpegurl" />
+ <data android:mimeType="application/vnd.rn-realmedia*" />
+ <data android:mimeType="application/x-iso9660-image" />
+ <data android:mimeType="application/x-extension-mp4" />
+ <data android:mimeType="application/x-flac" />
+ <data android:mimeType="application/x-matroska" />
+ <data android:mimeType="application/x-mpegURL" />
+ <data android:mimeType="application/x-ogg" />
+ <data android:mimeType="application/x-quicktimeplayer" />
+ </intent-filter>
+
+ <!-- Files with unknown MIME type.
+ The list of extensions and supported protocols can certainly be extended. -->
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+
+ <data android:scheme="file" />
+ <data android:scheme="http" />
+ <data android:scheme="https" />
+
+ <!-- video -->
+ <data android:pathPattern=".*\\.3g2" />
+ <data android:pathPattern=".*\\.3gp" />
+ <data android:pathPattern=".*\\.3gp2" />
+ <data android:pathPattern=".*\\.3gpp" />
+ <data android:pathPattern=".*\\.amv" />
+ <data android:pathPattern=".*\\.asf" />
+ <data android:pathPattern=".*\\.avi" />
+ <data android:pathPattern=".*\\.divx" />
+ <data android:pathPattern=".*\\.drc" />
+ <data android:pathPattern=".*\\.dv" />
+ <data android:pathPattern=".*\\.f4v" />
+ <data android:pathPattern=".*\\.flv" />
+ <data android:pathPattern=".*\\.gvi" />
+ <data android:pathPattern=".*\\.gxf" />
+ <data android:pathPattern=".*\\.ismv" />
+ <data android:pathPattern=".*\\.iso" />
+ <data android:pathPattern=".*\\.m1v" />
+ <data android:pathPattern=".*\\.m2v" />
+ <data android:pathPattern=".*\\.m2t" />
+ <data android:pathPattern=".*\\.m2ts" />
+ <!-- <data android:pathPattern=".*\\.m3u" /> -->
+ <data android:pathPattern=".*\\.m3u8" />
+ <data android:pathPattern=".*\\.mkv" />
+ <data android:pathPattern=".*\\.mov" />
+ <data android:pathPattern=".*\\.mp2" />
+ <data android:pathPattern=".*\\.mp2v" />
+ <data android:pathPattern=".*\\.mp4" />
+ <data android:pathPattern=".*\\.mp4v" />
+ <data android:pathPattern=".*\\.mpe" />
+ <data android:pathPattern=".*\\.mpeg" />
+ <data android:pathPattern=".*\\.mpeg1" />
+ <data android:pathPattern=".*\\.mpeg2" />
+ <data android:pathPattern=".*\\.mpeg4" />
+ <data android:pathPattern=".*\\.mpg" />
+ <data android:pathPattern=".*\\.mpv2" />
+ <data android:pathPattern=".*\\.mts" />
+ <data android:pathPattern=".*\\.mtv" />
+ <data android:pathPattern=".*\\.mxf" />
+ <data android:pathPattern=".*\\.mxg" />
+ <data android:pathPattern=".*\\.nsv" />
+ <data android:pathPattern=".*\\.nut" />
+ <data android:pathPattern=".*\\.nuv" />
+ <data android:pathPattern=".*\\.ogm" />
+ <data android:pathPattern=".*\\.ogv" />
+ <data android:pathPattern=".*\\.ogx" />
+ <data android:pathPattern=".*\\.ps" />
+ <data android:pathPattern=".*\\.rec" />
+ <data android:pathPattern=".*\\.rm" />
+ <data android:pathPattern=".*\\.rmvb" />
+ <data android:pathPattern=".*\\.tod" />
+ <data android:pathPattern=".*\\.ts" />
+ <data android:pathPattern=".*\\.tts" />
+ <data android:pathPattern=".*\\.vob" />
+ <data android:pathPattern=".*\\.vro" />
+ <data android:pathPattern=".*\\.webm" />
+ <data android:pathPattern=".*\\.wm" />
+ <data android:pathPattern=".*\\.wmv" />
+ <data android:pathPattern=".*\\.wtv" />
+ <data android:pathPattern=".*\\.xesc" />
+ <data android:pathPattern=".*\\.3G2" />
+ <data android:pathPattern=".*\\.3GP" />
+ <data android:pathPattern=".*\\.3GP2" />
+ <data android:pathPattern=".*\\.3GPP" />
+ <data android:pathPattern=".*\\.AMV" />
+ <data android:pathPattern=".*\\.ASF" />
+ <data android:pathPattern=".*\\.AVI" />
+ <data android:pathPattern=".*\\.DIVX" />
+ <data android:pathPattern=".*\\.DRC" />
+ <data android:pathPattern=".*\\.DV" />
+ <data android:pathPattern=".*\\.F4V" />
+ <data android:pathPattern=".*\\.FLV" />
+ <data android:pathPattern=".*\\.GVI" />
+ <data android:pathPattern=".*\\.GXF" />
+ <data android:pathPattern=".*\\.ISMV" />
+ <data android:pathPattern=".*\\.ISO" />
+ <data android:pathPattern=".*\\.M1V" />
+ <data android:pathPattern=".*\\.M2V" />
+ <data android:pathPattern=".*\\.M2T" />
+ <data android:pathPattern=".*\\.M2TS" />
+ <!-- <data android:pathPattern=".*\\.M3U" /> -->
+ <data android:pathPattern=".*\\.M3U8" />
+ <data android:pathPattern=".*\\.MKV" />
+ <data android:pathPattern=".*\\.MOV" />
+ <data android:pathPattern=".*\\.MP2" />
+ <data android:pathPattern=".*\\.MP2V" />
+ <data android:pathPattern=".*\\.MP4" />
+ <data android:pathPattern=".*\\.MP4V" />
+ <data android:pathPattern=".*\\.MPE" />
+ <data android:pathPattern=".*\\.MPEG" />
+ <data android:pathPattern=".*\\.MPEG1" />
+ <data android:pathPattern=".*\\.MPEG2" />
+ <data android:pathPattern=".*\\.MPEG4" />
+ <data android:pathPattern=".*\\.MPG" />
+ <data android:pathPattern=".*\\.MPV2" />
+ <data android:pathPattern=".*\\.MTS" />
+ <data android:pathPattern=".*\\.MTV" />
+ <data android:pathPattern=".*\\.MXF" />
+ <data android:pathPattern=".*\\.MXG" />
+ <data android:pathPattern=".*\\.NSV" />
+ <data android:pathPattern=".*\\.NUT" />
+ <data android:pathPattern=".*\\.NUV" />
+ <data android:pathPattern=".*\\.OGM" />
+ <data android:pathPattern=".*\\.OGV" />
+ <data android:pathPattern=".*\\.OGX" />
+ <data android:pathPattern=".*\\.PS" />
+ <data android:pathPattern=".*\\.REC" />
+ <data android:pathPattern=".*\\.RM" />
+ <data android:pathPattern=".*\\.RMVB" />
+ <data android:pathPattern=".*\\.TOD" />
+ <data android:pathPattern=".*\\.TS" />
+ <data android:pathPattern=".*\\.TTS" />
+ <data android:pathPattern=".*\\.VOB" />
+ <data android:pathPattern=".*\\.VRO" />
+ <data android:pathPattern=".*\\.WEBM" />
+ <data android:pathPattern=".*\\.WM" />
+ <data android:pathPattern=".*\\.WMV" />
+ <data android:pathPattern=".*\\.WTV" />
+ <data android:pathPattern=".*\\.XESC" />
+
+ <!-- audio -->
+ <data android:pathPattern=".*\\.3ga" />
+ <data android:pathPattern=".*\\.a52" />
+ <data android:pathPattern=".*\\.aac" />
+ <data android:pathPattern=".*\\.ac3" />
+ <data android:pathPattern=".*\\.adt" />
+ <data android:pathPattern=".*\\.adts" />
+ <data android:pathPattern=".*\\.aif" />
+ <data android:pathPattern=".*\\.aifc" />
+ <data android:pathPattern=".*\\.aiff" />
+ <data android:pathPattern=".*\\.amr" />
+ <data android:pathPattern=".*\\.aob" />
+ <data android:pathPattern=".*\\.ape" />
+ <data android:pathPattern=".*\\.awb" />
+ <data android:pathPattern=".*\\.caf" />
+ <data android:pathPattern=".*\\.dts" />
+ <data android:pathPattern=".*\\.flac" />
+ <data android:pathPattern=".*\\.it" />
+ <data android:pathPattern=".*\\.m4a" />
+ <data android:pathPattern=".*\\.m4b" />
+ <data android:pathPattern=".*\\.m4p" />
+ <data android:pathPattern=".*\\.mid" />
+ <data android:pathPattern=".*\\.mka" />
+ <data android:pathPattern=".*\\.mlp" />
+ <data android:pathPattern=".*\\.mod" />
+ <data android:pathPattern=".*\\.mpa" />
+ <data android:pathPattern=".*\\.mp1" />
+ <data android:pathPattern=".*\\.mp2" />
+ <data android:pathPattern=".*\\.mp3" />
+ <data android:pathPattern=".*\\.mpc" />
+ <data android:pathPattern=".*\\.mpga" />
+ <data android:pathPattern=".*\\.oga" />
+ <data android:pathPattern=".*\\.ogg" />
+ <data android:pathPattern=".*\\.oma" />
+ <data android:pathPattern=".*\\.opus" />
+ <data android:pathPattern=".*\\.ra" />
+ <data android:pathPattern=".*\\.ram" />
+ <data android:pathPattern=".*\\.rmi" />
+ <data android:pathPattern=".*\\.s3m" />
+ <data android:pathPattern=".*\\.spx" />
+ <data android:pathPattern=".*\\.tta" />
+ <data android:pathPattern=".*\\.voc" />
+ <data android:pathPattern=".*\\.vqf" />
+ <data android:pathPattern=".*\\.w64" />
+ <data android:pathPattern=".*\\.wav" />
+ <data android:pathPattern=".*\\.wma" />
+ <data android:pathPattern=".*\\.wv" />
+ <data android:pathPattern=".*\\.xa" />
+ <data android:pathPattern=".*\\.xm" />
+ <data android:pathPattern=".*\\.3GA" />
+ <data android:pathPattern=".*\\.A52" />
+ <data android:pathPattern=".*\\.AAC" />
+ <data android:pathPattern=".*\\.AC3" />
+ <data android:pathPattern=".*\\.ADT" />
+ <data android:pathPattern=".*\\.ADTS" />
+ <data android:pathPattern=".*\\.AIF" />
+ <data android:pathPattern=".*\\.AIFC" />
+ <data android:pathPattern=".*\\.AIFF" />
+ <data android:pathPattern=".*\\.AMR" />
+ <data android:pathPattern=".*\\.AOB" />
+ <data android:pathPattern=".*\\.APE" />
+ <data android:pathPattern=".*\\.AWB" />
+ <data android:pathPattern=".*\\.CAF" />
+ <data android:pathPattern=".*\\.DTS" />
+ <data android:pathPattern=".*\\.FLAC" />
+ <data android:pathPattern=".*\\.IT" />
+ <data android:pathPattern=".*\\.M4A" />
+ <data android:pathPattern=".*\\.M4B" />
+ <data android:pathPattern=".*\\.M4P" />
+ <data android:pathPattern=".*\\.MID" />
+ <data android:pathPattern=".*\\.MKA" />
+ <data android:pathPattern=".*\\.MLP" />
+ <data android:pathPattern=".*\\.MOD" />
+ <data android:pathPattern=".*\\.MPA" />
+ <data android:pathPattern=".*\\.MP1" />
+ <data android:pathPattern=".*\\.MP2" />
+ <data android:pathPattern=".*\\.MP3" />
+ <data android:pathPattern=".*\\.MPC" />
+ <data android:pathPattern=".*\\.MPGA" />
+ <data android:pathPattern=".*\\.OGA" />
+ <data android:pathPattern=".*\\.OGG" />
+ <data android:pathPattern=".*\\.OMA" />
+ <data android:pathPattern=".*\\.OPUS" />
+ <data android:pathPattern=".*\\.RA" />
+ <data android:pathPattern=".*\\.RAM" />
+ <data android:pathPattern=".*\\.RMI" />
+ <data android:pathPattern=".*\\.S3M" />
+ <data android:pathPattern=".*\\.SPX" />
+ <data android:pathPattern=".*\\.TTA" />
+ <data android:pathPattern=".*\\.VOC" />
+ <data android:pathPattern=".*\\.VQF" />
+ <data android:pathPattern=".*\\.W64" />
+ <data android:pathPattern=".*\\.WAV" />
+ <data android:pathPattern=".*\\.WMA" />
+ <data android:pathPattern=".*\\.WV" />
+ <data android:pathPattern=".*\\.XA" />
+ <data android:pathPattern=".*\\.XM" />
+ </intent-filter>
+
+ <!-- Remote URI schemes without types -->
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+
+ <data android:scheme="rtmp" />
+ <data android:scheme="rtmpt" />
+ <data android:scheme="rtmps" />
+ <data android:scheme="rtmpe" />
+ <data android:scheme="rtmfp" />
+ <data android:scheme="rtmpte" />
+ <data android:scheme="rtmpts" />
+ <data android:scheme="rtsp" />
+ <data android:scheme="rtspu" />
+ <data android:scheme="rtspt" />
+ <data android:scheme="rtsph" />
+ <data android:scheme="rtsp-sdp" />
+ <data android:scheme="rtsps" />
+ <data android:scheme="rtspsu" />
+ <data android:scheme="rtspst" />
+ <data android:scheme="rtspsh" />
+ <data android:scheme="mms" />
+ <data android:scheme="mmsh" />
+ <data android:scheme="mmst" />
+ <data android:scheme="mmsu" />
+ <data android:scheme="icy" />
+ <data android:scheme="icyx" />
+ <data android:scheme="udp" />
+ </intent-filter>
+
+ <!-- Remote URI schemes with types -->
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+
+ <data android:mimeType="audio/*" />
+ <data android:mimeType="video/*" />
+ <data android:mimeType="image/*" />
+
+ <data android:scheme="rtmp" />
+ <data android:scheme="rtmpt" />
+ <data android:scheme="rtmps" />
+ <data android:scheme="rtmpe" />
+ <data android:scheme="rtmfp" />
+ <data android:scheme="rtmpte" />
+ <data android:scheme="rtmpts" />
+ <data android:scheme="rtsp" />
+ <data android:scheme="rtspu" />
+ <data android:scheme="rtspt" />
+ <data android:scheme="rtsph" />
+ <data android:scheme="rtsp-sdp" />
+ <data android:scheme="rtsps" />
+ <data android:scheme="rtspsu" />
+ <data android:scheme="rtspst" />
+ <data android:scheme="rtspsh" />
+ <data android:scheme="mms" />
+ <data android:scheme="mmsh" />
+ <data android:scheme="mmst" />
+ <data android:scheme="mmsu" />
+ <data android:scheme="icy" />
+ <data android:scheme="icyx" />
+ <data android:scheme="udp" />
+ </intent-filter>
+
+ </activity>
+ </application>
+</manifest>
diff --git a/playback/player/android/app/src/main/java/org/freedesktop/gstreamer/Player.java b/playback/player/android/app/src/main/java/org/freedesktop/gstreamer/Player.java
new file mode 100644
index 0000000..e2bef8c
--- /dev/null
+++ b/playback/player/android/app/src/main/java/org/freedesktop/gstreamer/Player.java
@@ -0,0 +1,241 @@
+/* GStreamer
+ *
+ * Copyright (C) 2014-2015 Sebastian Dröge <sebastian@centricular.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+package org.freedesktop.gstreamer;
+
+import java.io.Closeable;
+import android.view.Surface;
+import android.content.Context;
+import org.freedesktop.gstreamer.GStreamer;
+
+public class Player implements Closeable {
+ private static native void nativeClassInit();
+ public static void init(Context context) throws Exception {
+ System.loadLibrary("gstreamer_android");
+ GStreamer.init(context);
+
+ System.loadLibrary("gstplayer");
+ nativeClassInit();
+ }
+
+ private long native_player;
+ private native void nativeNew();
+ public Player() {
+ nativeNew();
+ }
+
+ private native void nativeFree();
+ @Override
+ public void close() {
+ nativeFree();
+ }
+
+ private native void nativePlay();
+ public void play() {
+ nativePlay();
+ }
+
+ private native void nativePause();
+ public void pause() {
+ nativePause();
+ }
+
+ private native void nativeStop();
+ public void stop() {
+ nativeStop();
+ }
+
+ private native void nativeSeek(long position);
+ public void seek(long position) {
+ nativeSeek(position);
+ }
+
+ private native String nativeGetUri();
+ public String getUri() {
+ return nativeGetUri();
+ }
+
+ private native void nativeSetUri(String uri);
+ public void setUri(String uri) {
+ nativeSetUri(uri);
+ }
+
+ private native long nativeGetPosition();
+ public long getPosition() {
+ return nativeGetPosition();
+ }
+
+ private native long nativeGetDuration();
+ public long getDuration() {
+ return nativeGetDuration();
+ }
+
+ private native double nativeGetVolume();
+ public double getVolume() {
+ return nativeGetVolume();
+ }
+
+ private native void nativeSetVolume(double volume);
+ public void setVolume(double volume) {
+ nativeSetVolume(volume);
+ }
+
+ private native boolean nativeGetMute();
+ public boolean getMute() {
+ return nativeGetMute();
+ }
+
+ private native void nativeSetMute(boolean mute);
+ public void setMute(boolean mute) {
+ nativeSetMute(mute);
+ }
+
+ private Surface surface;
+ private native void nativeSetSurface(Surface surface);
+ public void setSurface(Surface surface) {
+ this.surface = surface;
+ nativeSetSurface(surface);
+ }
+
+ public Surface getSurface() {
+ return surface;
+ }
+
+ public static interface PositionUpdatedListener {
+ abstract void positionUpdated(Player player, long position);
+ }
+
+ private PositionUpdatedListener positionUpdatedListener;
+ public void setPositionUpdatedListener(PositionUpdatedListener listener) {
+ positionUpdatedListener = listener;
+ }
+
+ private void onPositionUpdated(long position) {
+ if (positionUpdatedListener != null) {
+ positionUpdatedListener.positionUpdated(this, position);
+ }
+ }
+
+ public static interface DurationChangedListener {
+ abstract void durationChanged(Player player, long duration);
+ }
+
+ private DurationChangedListener durationChangedListener;
+ public void setDurationChangedListener(DurationChangedListener listener) {
+ durationChangedListener = listener;
+ }
+
+ private void onDurationChanged(long duration) {
+ if (durationChangedListener != null) {
+ durationChangedListener.durationChanged(this, duration);
+ }
+ }
+
+ private static final State[] stateMap = {State.STOPPED, State.BUFFERING, State.PAUSED, State.PLAYING};
+ public enum State {
+ STOPPED,
+ BUFFERING,
+ PAUSED,
+ PLAYING
+ }
+
+ public static interface StateChangedListener {
+ abstract void stateChanged(Player player, State state);
+ }
+
+ private StateChangedListener stateChangedListener;
+ public void setStateChangedListener(StateChangedListener listener) {
+ stateChangedListener = listener;
+ }
+
+ private void onStateChanged(int stateIdx) {
+ if (stateChangedListener != null) {
+ State state = stateMap[stateIdx];
+ stateChangedListener.stateChanged(this, state);
+ }
+ }
+
+ public static interface BufferingListener {
+ abstract void buffering(Player player, int percent);
+ }
+
+ private BufferingListener bufferingListener;
+ public void setBufferingListener(BufferingListener listener) {
+ bufferingListener = listener;
+ }
+
+ private void onBuffering(int percent) {
+ if (bufferingListener != null) {
+ bufferingListener.buffering(this, percent);
+ }
+ }
+
+ public static interface EndOfStreamListener {
+ abstract void endOfStream(Player player);
+ }
+
+ private EndOfStreamListener endOfStreamListener;
+ public void setEndOfStreamListener(EndOfStreamListener listener) {
+ endOfStreamListener = listener;
+ }
+
+ private void onEndOfStream() {
+ if (endOfStreamListener != null) {
+ endOfStreamListener.endOfStream(this);
+ }
+ }
+
+ // Keep these in sync with gstplayer.h
+ private static final Error[] errorMap = {Error.FAILED};
+ public enum Error {
+ FAILED
+ }
+
+ public static interface ErrorListener {
+ abstract void error(Player player, Error error, String errorMessage);
+ }
+
+ private ErrorListener errorListener;
+ public void setErrorListener(ErrorListener listener) {
+ errorListener = listener;
+ }
+
+ private void onError(int errorCode, String errorMessage) {
+ if (errorListener != null) {
+ Error error = errorMap[errorCode];
+ errorListener.error(this, error, errorMessage);
+ }
+ }
+
+ public static interface VideoDimensionsChangedListener {
+ abstract void videoDimensionsChanged(Player player, int width, int height);
+ }
+
+ private VideoDimensionsChangedListener videoDimensionsChangedListener;
+ public void setVideoDimensionsChangedListener(VideoDimensionsChangedListener listener) {
+ videoDimensionsChangedListener = listener;
+ }
+
+ private void onVideoDimensionsChanged(int width, int height) {
+ if (videoDimensionsChangedListener != null) {
+ videoDimensionsChangedListener.videoDimensionsChanged(this, width, height);
+ }
+ }
+}
diff --git a/playback/player/android/app/src/main/java/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java b/playback/player/android/app/src/main/java/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java
new file mode 100644
index 0000000..075f035
--- /dev/null
+++ b/playback/player/android/app/src/main/java/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java
@@ -0,0 +1,110 @@
+/* GStreamer
+ *
+ * Copyright (C) 2014 Sebastian Dröge <sebastian@centricular.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+package org.freedesktop.gstreamer.play;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.SurfaceView;
+import android.view.View;
+
+// A simple SurfaceView whose width and height can be set from the outside
+public class GStreamerSurfaceView extends SurfaceView {
+ public int media_width = 320;
+ public int media_height = 240;
+
+ // Mandatory constructors, they do not do much
+ public GStreamerSurfaceView(Context context, AttributeSet attrs,
+ int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ public GStreamerSurfaceView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public GStreamerSurfaceView (Context context) {
+ super(context);
+ }
+
+ // Called by the layout manager to find out our size and give us some rules.
+ // We will try to maximize our size, and preserve the media's aspect ratio if
+ // we are given the freedom to do so.
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ if (media_width == 0 || media_height == 0) {
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+ return;
+ }
+
+ int width = 0, height = 0;
+ int wmode = View.MeasureSpec.getMode(widthMeasureSpec);
+ int hmode = View.MeasureSpec.getMode(heightMeasureSpec);
+ int wsize = View.MeasureSpec.getSize(widthMeasureSpec);
+ int hsize = View.MeasureSpec.getSize(heightMeasureSpec);
+
+ Log.i ("GStreamer", "onMeasure called with " + media_width + "x" + media_height);
+ // Obey width rules
+ switch (wmode) {
+ case View.MeasureSpec.AT_MOST:
+ if (hmode == View.MeasureSpec.EXACTLY) {
+ width = Math.min(hsize * media_width / media_height, wsize);
+ break;
+ }
+ case View.MeasureSpec.EXACTLY:
+ width = wsize;
+ break;
+ case View.MeasureSpec.UNSPECIFIED:
+ width = media_width;
+ }
+
+ // Obey height rules
+ switch (hmode) {
+ case View.MeasureSpec.AT_MOST:
+ if (wmode == View.MeasureSpec.EXACTLY) {
+ height = Math.min(wsize * media_height / media_width, hsize);
+ break;
+ }
+ case View.MeasureSpec.EXACTLY:
+ height = hsize;
+ break;
+ case View.MeasureSpec.UNSPECIFIED:
+ height = media_height;
+ }
+
+ // Finally, calculate best size when both axis are free
+ if (hmode == View.MeasureSpec.AT_MOST && wmode == View.MeasureSpec.AT_MOST) {
+ int correct_height = width * media_height / media_width;
+ int correct_width = height * media_width / media_height;
+
+ if (correct_height < height)
+ height = correct_height;
+ else
+ width = correct_width;
+ }
+
+ // Obey minimum size
+ width = Math.max (getSuggestedMinimumWidth(), width);
+ height = Math.max (getSuggestedMinimumHeight(), height);
+ setMeasuredDimension(width, height);
+ }
+
+}
diff --git a/playback/player/android/app/src/main/java/org/freedesktop/gstreamer/player/Play.java b/playback/player/android/app/src/main/java/org/freedesktop/gstreamer/player/Play.java
new file mode 100644
index 0000000..2874f05
--- /dev/null
+++ b/playback/player/android/app/src/main/java/org/freedesktop/gstreamer/player/Play.java
@@ -0,0 +1,196 @@
+/* GStreamer
+ *
+ * Copyright (C) 2014 Sebastian Dröge <sebastian@centricular.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+package org.freedesktop.gstreamer.play;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.PowerManager;
+import android.util.Log;
+import android.view.SurfaceHolder;
+import android.view.SurfaceView;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.ImageButton;
+import android.widget.SeekBar;
+import android.widget.SeekBar.OnSeekBarChangeListener;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import org.freedesktop.gstreamer.Player;
+
+public class Play extends Activity implements SurfaceHolder.Callback, OnSeekBarChangeListener {
+ private PowerManager.WakeLock wake_lock;
+ private Player player;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+
+ try {
+ Player.init(this);
+ } catch (Exception e) {
+ Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
+ finish();
+ return;
+ }
+
+ setContentView(R.layout.main);
+
+ player = new Player();
+
+ PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
+ wake_lock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "GStreamer Play");
+ wake_lock.setReferenceCounted(false);
+
+ ImageButton play = (ImageButton) this.findViewById(R.id.button_play);
+ play.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ player.play();
+ wake_lock.acquire();
+ }
+ });
+
+ ImageButton pause = (ImageButton) this.findViewById(R.id.button_pause);
+ pause.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ player.pause();
+ wake_lock.release();
+ }
+ });
+
+ final SeekBar sb = (SeekBar) this.findViewById(R.id.seek_bar);
+ sb.setOnSeekBarChangeListener(this);
+
+ player.setPositionUpdatedListener(new Player.PositionUpdatedListener() {
+ public void positionUpdated(Player player, final long position) {
+ runOnUiThread (new Runnable() {
+ public void run() {
+ sb.setProgress((int) (position / 1000000));
+ updateTimeWidget();
+ }
+ });
+ }
+ });
+
+ player.setDurationChangedListener(new Player.DurationChangedListener() {
+ public void durationChanged(Player player, final long duration) {
+ runOnUiThread (new Runnable() {
+ public void run() {
+ sb.setMax((int) (duration / 1000000));
+ updateTimeWidget();
+ }
+ });
+ }
+ });
+
+ final GStreamerSurfaceView gsv = (GStreamerSurfaceView) this.findViewById(R.id.surface_video);
+ player.setVideoDimensionsChangedListener(new Player.VideoDimensionsChangedListener() {
+ public void videoDimensionsChanged(Player player, final int width, final int height) {
+ runOnUiThread (new Runnable() {
+ public void run() {
+ Log.i ("GStreamer", "Media size changed to " + width + "x" + height);
+ gsv.media_width = width;
+ gsv.media_height = height;
+ runOnUiThread(new Runnable() {
+ public void run() {
+ gsv.requestLayout();
+ }
+ });
+ }
+ });
+ }
+ });
+
+ SurfaceView sv = (SurfaceView) this.findViewById(R.id.surface_video);
+ SurfaceHolder sh = sv.getHolder();
+ sh.addCallback(this);
+
+ String mediaUri = null;
+ Intent intent = getIntent();
+ android.net.Uri uri = intent.getData();
+ Log.i ("GStreamer", "Received URI: " + uri);
+ if (uri.getScheme().equals("content")) {
+ android.database.Cursor cursor = getContentResolver().query(uri, null, null, null, null);
+ cursor.moveToFirst();
+ mediaUri = "file://" + cursor.getString(cursor.getColumnIndex(android.provider.MediaStore.Video.Media.DATA));
+ cursor.close();
+ } else {
+ mediaUri = uri.toString();
+ }
+ player.setUri(mediaUri);
+
+ updateTimeWidget();
+ }
+
+ protected void onDestroy() {
+ player.close();
+ super.onDestroy();
+ }
+
+ private void updateTimeWidget () {
+ final TextView tv = (TextView) this.findViewById(R.id.textview_time);
+ final SeekBar sb = (SeekBar) this.findViewById(R.id.seek_bar);
+ final int pos = sb.getProgress();
+ final int max = sb.getMax();
+
+ SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
+ df.setTimeZone(TimeZone.getTimeZone("UTC"));
+ final String message = df.format(new Date (pos)) + " / " + df.format(new Date (max));
+ tv.setText(message);
+ }
+
+ public void surfaceChanged(SurfaceHolder holder, int format, int width,
+ int height) {
+ Log.d("GStreamer", "Surface changed to format " + format + " width "
+ + width + " height " + height);
+ player.setSurface(holder.getSurface());
+ }
+
+ public void surfaceCreated(SurfaceHolder holder) {
+ Log.d("GStreamer", "Surface created: " + holder.getSurface());
+ }
+
+ public void surfaceDestroyed(SurfaceHolder holder) {
+ Log.d("GStreamer", "Surface destroyed");
+ player.setSurface(null);
+ }
+
+ public void onProgressChanged(SeekBar sb, int progress, boolean fromUser) {
+ if (!fromUser) return;
+
+ updateTimeWidget();
+ }
+
+ public void onStartTrackingTouch(SeekBar sb) {
+ }
+
+ public void onStopTrackingTouch(SeekBar sb) {
+ Log.d("GStreamer", "Seek to " + sb.getProgress());
+ player.seek(((long) sb.getProgress()) * 1000000);
+ }
+}
diff --git a/playback/player/android/app/src/main/jni/Android.mk b/playback/player/android/app/src/main/jni/Android.mk
new file mode 100644
index 0000000..65e2044
--- /dev/null
+++ b/playback/player/android/app/src/main/jni/Android.mk
@@ -0,0 +1,39 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := gstplayer
+LOCAL_SRC_FILES := player.c
+
+LOCAL_SHARED_LIBRARIES := gstreamer_android
+LOCAL_LDLIBS := -llog -landroid
+include $(BUILD_SHARED_LIBRARY)
+
+ifeq ($(TARGET_ARCH_ABI),armeabi)
+GSTREAMER_ROOT := $(GSTREAMER_ROOT_ARM)
+else ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
+GSTREAMER_ROOT := $(GSTREAMER_ROOT_ARMV7)
+else ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
+GSTREAMER_ROOT := $(GSTREAMER_ROOT_ARM64)
+else ifeq ($(TARGET_ARCH_ABI),x86)
+GSTREAMER_ROOT := $(GSTREAMER_ROOT_X86)
+else ifeq ($(TARGET_ARCH_ABI),x86_64)
+GSTREAMER_ROOT := $(GSTREAMER_ROOT_X86_64)
+else
+$(error Target arch ABI not supported)
+endif
+
+ifndef GSTREAMER_ROOT
+ifndef GSTREAMER_ROOT_ANDROID
+$(error GSTREAMER_ROOT_ANDROID is not defined!)
+endif
+GSTREAMER_ROOT := $(GSTREAMER_ROOT_ANDROID)
+endif
+
+GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_ROOT)/share/gst-android/ndk-build/
+
+include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
+GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_PLAYBACK) $(GSTREAMER_PLUGINS_CODECS) $(GSTREAMER_PLUGINS_NET) $(GSTREAMER_PLUGINS_SYS) $(GSTREAMER_PLUGINS_CODECS_RESTRICTED) $(GSTREAMER_CODECS_GPL) $(GSTREAMER_PLUGINS_ENCODING) $(GSTREAMER_PLUGINS_VIS) $(GSTREAMER_PLUGINS_EFFECTS) $(GSTREAMER_PLUGINS_NET_RESTRICTED)
+GSTREAMER_EXTRA_DEPS := gstreamer-player-1.0 gstreamer-video-1.0 glib-2.0
+
+include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk
diff --git a/playback/player/android/app/src/main/jni/Application.mk b/playback/player/android/app/src/main/jni/Application.mk
new file mode 100644
index 0000000..87c0990
--- /dev/null
+++ b/playback/player/android/app/src/main/jni/Application.mk
@@ -0,0 +1 @@
+APP_PLATFORM = 15
diff --git a/playback/player/android/app/src/main/jni/player.c b/playback/player/android/app/src/main/jni/player.c
new file mode 100644
index 0000000..58d177e
--- /dev/null
+++ b/playback/player/android/app/src/main/jni/player.c
@@ -0,0 +1,497 @@
+/* GStreamer
+ *
+ * Copyright (C) 2014 Sebastian Dröge <sebastian@centricular.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <string.h>
+#include <stdint.h>
+#include <jni.h>
+#include <android/log.h>
+#include <android/native_window.h>
+#include <android/native_window_jni.h>
+
+#include <gst/player/player.h>
+
+GST_DEBUG_CATEGORY_STATIC (debug_category);
+#define GST_CAT_DEFAULT debug_category
+
+#define GET_CUSTOM_DATA(env, thiz, fieldID) (Player *)(gintptr)(*env)->GetLongField (env, thiz, fieldID)
+#define SET_CUSTOM_DATA(env, thiz, fieldID, data) (*env)->SetLongField (env, thiz, fieldID, (jlong)(gintptr)data)
+
+typedef struct _Player
+{
+ jobject java_player;
+ GstPlayer *player;
+ GstPlayerVideoRenderer *renderer;
+ ANativeWindow *native_window;
+} Player;
+
+static pthread_key_t current_jni_env;
+static JavaVM *java_vm;
+static jfieldID native_player_field_id;
+static jmethodID on_position_updated_method_id;
+static jmethodID on_duration_changed_method_id;
+static jmethodID on_state_changed_method_id;
+static jmethodID on_buffering_method_id;
+static jmethodID on_end_of_stream_method_id;
+static jmethodID on_error_method_id;
+static jmethodID on_video_dimensions_changed_method_id;
+
+/* Register this thread with the VM */
+static JNIEnv *
+attach_current_thread (void)
+{
+ JNIEnv *env;
+ JavaVMAttachArgs args;
+
+ GST_DEBUG ("Attaching thread %p", g_thread_self ());
+ args.version = JNI_VERSION_1_4;
+ args.name = NULL;
+ args.group = NULL;
+
+ if ((*java_vm)->AttachCurrentThread (java_vm, &env, &args) < 0) {
+ GST_ERROR ("Failed to attach current thread");
+ return NULL;
+ }
+
+ return env;
+}
+
+/* Unregister this thread from the VM */
+static void
+detach_current_thread (void *env)
+{
+ GST_DEBUG ("Detaching thread %p", g_thread_self ());
+ (*java_vm)->DetachCurrentThread (java_vm);
+}
+
+/* Retrieve the JNI environment for this thread */
+static JNIEnv *
+get_jni_env (void)
+{
+ JNIEnv *env;
+
+ if ((env = pthread_getspecific (current_jni_env)) == NULL) {
+ env = attach_current_thread ();
+ pthread_setspecific (current_jni_env, env);
+ }
+
+ return env;
+}
+
+/*
+ * Java Bindings
+ */
+static void
+on_position_updated (GstPlayer * unused, GstClockTime position, Player * player)
+{
+ JNIEnv *env = get_jni_env ();
+
+ (*env)->CallVoidMethod (env, player->java_player,
+ on_position_updated_method_id, position);
+ if ((*env)->ExceptionCheck (env)) {
+ (*env)->ExceptionDescribe (env);
+ (*env)->ExceptionClear (env);
+ }
+}
+
+static void
+on_duration_changed (GstPlayer * unused, GstClockTime duration, Player * player)
+{
+ JNIEnv *env = get_jni_env ();
+
+ (*env)->CallVoidMethod (env, player->java_player,
+ on_duration_changed_method_id, duration);
+ if ((*env)->ExceptionCheck (env)) {
+ (*env)->ExceptionDescribe (env);
+ (*env)->ExceptionClear (env);
+ }
+}
+
+static void
+on_state_changed (GstPlayer * unused, GstPlayerState state, Player * player)
+{
+ JNIEnv *env = get_jni_env ();
+
+ (*env)->CallVoidMethod (env, player->java_player,
+ on_state_changed_method_id, state);
+ if ((*env)->ExceptionCheck (env)) {
+ (*env)->ExceptionDescribe (env);
+ (*env)->ExceptionClear (env);
+ }
+}
+
+static void
+on_buffering (GstPlayer * unused, gint percent, Player * player)
+{
+ JNIEnv *env = get_jni_env ();
+
+ (*env)->CallVoidMethod (env, player->java_player,
+ on_buffering_method_id, percent);
+ if ((*env)->ExceptionCheck (env)) {
+ (*env)->ExceptionDescribe (env);
+ (*env)->ExceptionClear (env);
+ }
+}
+
+static void
+on_end_of_stream (GstPlayer * unused, Player * player)
+{
+ JNIEnv *env = get_jni_env ();
+
+ (*env)->CallVoidMethod (env, player->java_player, on_end_of_stream_method_id);
+ if ((*env)->ExceptionCheck (env)) {
+ (*env)->ExceptionDescribe (env);
+ (*env)->ExceptionClear (env);
+ }
+}
+
+static void
+on_error (GstPlayer * unused, GError * err, Player * player)
+{
+ JNIEnv *env = get_jni_env ();
+ jstring error_msg;
+
+ error_msg = (*env)->NewStringUTF (env, err->message);
+
+ (*env)->CallVoidMethod (env, player->java_player, on_error_method_id,
+ err->code, error_msg);
+ if ((*env)->ExceptionCheck (env)) {
+ (*env)->ExceptionDescribe (env);
+ (*env)->ExceptionClear (env);
+ }
+
+ (*env)->DeleteLocalRef (env, error_msg);
+}
+
+static void
+on_video_dimensions_changed (GstPlayer * unused, gint width, gint height,
+ Player * player)
+{
+ JNIEnv *env = get_jni_env ();
+
+ (*env)->CallVoidMethod (env, player->java_player,
+ on_video_dimensions_changed_method_id, width, height);
+ if ((*env)->ExceptionCheck (env)) {
+ (*env)->ExceptionDescribe (env);
+ (*env)->ExceptionClear (env);
+ }
+}
+
+static void
+native_new (JNIEnv * env, jobject thiz)
+{
+ Player *player = g_new0 (Player, 1);
+
+ player->renderer = gst_player_video_overlay_video_renderer_new (NULL);
+ player->player = gst_player_new (player->renderer, NULL);
+ SET_CUSTOM_DATA (env, thiz, native_player_field_id, player);
+ player->java_player = (*env)->NewGlobalRef (env, thiz);
+
+ g_signal_connect (player->player, "position-updated",
+ G_CALLBACK (on_position_updated), player);
+ g_signal_connect (player->player, "duration-changed",
+ G_CALLBACK (on_duration_changed), player);
+ g_signal_connect (player->player, "state-changed",
+ G_CALLBACK (on_state_changed), player);
+ g_signal_connect (player->player, "buffering",
+ G_CALLBACK (on_buffering), player);
+ g_signal_connect (player->player, "end-of-stream",
+ G_CALLBACK (on_end_of_stream), player);
+ g_signal_connect (player->player, "error", G_CALLBACK (on_error), player);
+ g_signal_connect (player->player, "video-dimensions-changed",
+ G_CALLBACK (on_video_dimensions_changed), player);
+}
+
+static void
+native_free (JNIEnv * env, jobject thiz)
+{
+ Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);
+
+ if (!player)
+ return;
+
+ g_object_unref (player->player);
+ (*env)->DeleteGlobalRef (env, player->java_player);
+ g_free (player);
+ SET_CUSTOM_DATA (env, thiz, native_player_field_id, NULL);
+}
+
+static void
+native_play (JNIEnv * env, jobject thiz)
+{
+ Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);
+
+ if (!player)
+ return;
+
+ gst_player_play (player->player);
+}
+
+static void
+native_pause (JNIEnv * env, jobject thiz)
+{
+ Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);
+
+ if (!player)
+ return;
+
+ gst_player_pause (player->player);
+}
+
+static void
+native_stop (JNIEnv * env, jobject thiz)
+{
+ Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);
+
+ if (!player)
+ return;
+
+ gst_player_stop (player->player);
+}
+
+static void
+native_seek (JNIEnv * env, jobject thiz, jlong position)
+{
+ Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);
+
+ if (!player)
+ return;
+
+ gst_player_seek (player->player, position);
+}
+
+static void
+native_set_uri (JNIEnv * env, jobject thiz, jobject uri)
+{
+ Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);
+ const gchar *uri_str;
+
+ if (!player)
+ return;
+
+ uri_str = (*env)->GetStringUTFChars (env, uri, NULL);
+ g_object_set (player->player, "uri", uri_str, NULL);
+ (*env)->ReleaseStringUTFChars (env, uri, uri_str);
+}
+
+static jobject
+native_get_uri (JNIEnv * env, jobject thiz)
+{
+ Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);
+ jobject uri;
+ gchar *uri_str;
+
+ if (!player)
+ return NULL;
+
+ g_object_get (player->player, "uri", &uri_str, NULL);
+
+ uri = (*env)->NewStringUTF (env, uri_str);
+ g_free (uri_str);
+
+ return uri;
+}
+
+static jlong
+native_get_position (JNIEnv * env, jobject thiz)
+{
+ Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);
+ jdouble position;
+
+ if (!player)
+ return -1;
+
+ g_object_get (player->player, "position", &position, NULL);
+
+ return position;
+}
+
+static jlong
+native_get_duration (JNIEnv * env, jobject thiz)
+{
+ Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);
+ jlong duration;
+
+ if (!player)
+ return -1;
+
+ g_object_get (player->player, "duration", &duration, NULL);
+
+ return duration;
+}
+
+static jdouble
+native_get_volume (JNIEnv * env, jobject thiz)
+{
+ Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);
+ jdouble volume;
+
+ if (!player)
+ return 1.0;
+
+ g_object_get (player->player, "volume", &volume, NULL);
+
+ return volume;
+}
+
+static void
+native_set_volume (JNIEnv * env, jobject thiz, jdouble volume)
+{
+ Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);
+
+ if (!player)
+ return;
+
+ g_object_set (player->player, "volume", volume, NULL);
+}
+
+static jboolean
+native_get_mute (JNIEnv * env, jobject thiz)
+{
+ Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);
+ jboolean mute;
+
+ if (!player)
+ return FALSE;
+
+ g_object_get (player->player, "mute", &mute, NULL);
+
+ return mute;
+}
+
+static void
+native_set_mute (JNIEnv * env, jobject thiz, jboolean mute)
+{
+ Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);
+
+ if (!player)
+ return;
+
+ g_object_set (player->player, "mute", mute, NULL);
+}
+
+static void
+native_set_surface (JNIEnv * env, jobject thiz, jobject surface)
+{
+ Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);
+ ANativeWindow *new_native_window;
+
+ if (!player)
+ return;
+
+ new_native_window = surface ? ANativeWindow_fromSurface (env, surface) : NULL;
+ GST_DEBUG ("Received surface %p (native window %p)", surface,
+ new_native_window);
+
+ if (player->native_window) {
+ ANativeWindow_release (player->native_window);
+ }
+
+ player->native_window = new_native_window;
+ gst_player_video_overlay_video_renderer_set_window_handle
+ (GST_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER (player->renderer),
+ (gpointer) new_native_window);
+}
+
+static void
+native_class_init (JNIEnv * env, jclass klass)
+{
+ native_player_field_id =
+ (*env)->GetFieldID (env, klass, "native_player", "J");
+ on_position_updated_method_id =
+ (*env)->GetMethodID (env, klass, "onPositionUpdated", "(J)V");
+ on_duration_changed_method_id =
+ (*env)->GetMethodID (env, klass, "onDurationChanged", "(J)V");
+ on_state_changed_method_id =
+ (*env)->GetMethodID (env, klass, "onStateChanged", "(I)V");
+ on_buffering_method_id =
+ (*env)->GetMethodID (env, klass, "onBuffering", "(I)V");
+ on_end_of_stream_method_id =
+ (*env)->GetMethodID (env, klass, "onEndOfStream", "()V");
+ on_error_method_id =
+ (*env)->GetMethodID (env, klass, "onError", "(ILjava/lang/String;)V");
+ on_video_dimensions_changed_method_id =
+ (*env)->GetMethodID (env, klass, "onVideoDimensionsChanged", "(II)V");
+
+ if (!native_player_field_id ||
+ !on_position_updated_method_id || !on_duration_changed_method_id ||
+ !on_state_changed_method_id || !on_buffering_method_id ||
+ !on_end_of_stream_method_id ||
+ !on_error_method_id || !on_video_dimensions_changed_method_id) {
+ static const gchar *message =
+ "The calling class does not implement all necessary interface methods";
+ jclass exception_class = (*env)->FindClass (env, "java/lang/Exception");
+ __android_log_print (ANDROID_LOG_ERROR, "GstPlayer", "%s", message);
+ (*env)->ThrowNew (env, exception_class, message);
+ }
+
+ gst_debug_set_threshold_for_name ("gst-player", GST_LEVEL_TRACE);
+}
+
+/* List of implemented native methods */
+static JNINativeMethod native_methods[] = {
+ {"nativeClassInit", "()V", (void *) native_class_init},
+ {"nativeNew", "()V", (void *) native_new},
+ {"nativePlay", "()V", (void *) native_play},
+ {"nativePause", "()V", (void *) native_pause},
+ {"nativeStop", "()V", (void *) native_stop},
+ {"nativeSeek", "(J)V", (void *) native_seek},
+ {"nativeFree", "()V", (void *) native_free},
+ {"nativeGetUri", "()Ljava/lang/String;", (void *) native_get_uri},
+ {"nativeSetUri", "(Ljava/lang/String;)V", (void *) native_set_uri},
+ {"nativeGetPosition", "()J", (void *) native_get_position},
+ {"nativeGetDuration", "()J", (void *) native_get_duration},
+ {"nativeGetVolume", "()D", (void *) native_get_volume},
+ {"nativeSetVolume", "(D)V", (void *) native_set_volume},
+ {"nativeGetMute", "()Z", (void *) native_get_mute},
+ {"nativeSetMute", "(Z)V", (void *) native_set_mute},
+ {"nativeSetSurface", "(Landroid/view/Surface;)V",
+ (void *) native_set_surface}
+};
+
+/* Library initializer */
+jint
+JNI_OnLoad (JavaVM * vm, void *reserved)
+{
+ JNIEnv *env = NULL;
+
+ java_vm = vm;
+
+ if ((*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_4) != JNI_OK) {
+ __android_log_print (ANDROID_LOG_ERROR, "GstPlayer",
+ "Could not retrieve JNIEnv");
+ return 0;
+ }
+ jclass klass = (*env)->FindClass (env, "org/freedesktop/gstreamer/Player");
+ if (!klass) {
+ __android_log_print (ANDROID_LOG_ERROR, "GstPlayer",
+ "Could not retrieve class org.freedesktop.gstreamer.Player");
+ return 0;
+ }
+ if ((*env)->RegisterNatives (env, klass, native_methods,
+ G_N_ELEMENTS (native_methods))) {
+ __android_log_print (ANDROID_LOG_ERROR, "GstPlayer",
+ "Could not register native methods for org.freedesktop.gstreamer.Player");
+ return 0;
+ }
+
+ pthread_key_create (&current_jni_env, detach_current_thread);
+
+ return JNI_VERSION_1_4;
+}
diff --git a/playback/player/android/app/src/main/res/layout/main.xml b/playback/player/android/app/src/main/res/layout/main.xml
new file mode 100644
index 0000000..b745d80
--- /dev/null
+++ b/playback/player/android/app/src/main/res/layout/main.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center_vertical"
+ android:orientation="vertical" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="16dip"
+ android:gravity="center_horizontal"
+ android:orientation="horizontal" >
+
+ <ImageButton
+ android:id="@+id/button_play"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:contentDescription="@string/button_play"
+ android:src="@android:drawable/ic_media_play"
+ android:text="@string/button_play" />
+
+ <ImageButton
+ android:id="@+id/button_pause"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:contentDescription="@string/button_pause"
+ android:src="@android:drawable/ic_media_pause"
+ android:text="@string/button_pause" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="16dip"
+ android:gravity="center_horizontal"
+ android:orientation="horizontal" >
+
+ <TextView
+ android:id="@+id/textview_time"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_marginLeft="5dip"
+ android:layout_marginRight="5dip" />
+
+ <SeekBar
+ android:id="@+id/seek_bar"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_weight="1"
+ android:indeterminate="false" />
+ </LinearLayout>
+
+ <org.freedesktop.gstreamer.play.GStreamerSurfaceView
+ android:id="@+id/surface_video"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical|center_horizontal" />
+
+</LinearLayout>
diff --git a/playback/player/android/app/src/main/res/values/strings.xml b/playback/player/android/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..9587e3c
--- /dev/null
+++ b/playback/player/android/app/src/main/res/values/strings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">GStreamer Play</string>
+ <string name="button_play">Play</string>
+ <string name="button_pause">Pause</string>
+</resources>
diff --git a/playback/player/android/build.gradle b/playback/player/android/build.gradle
new file mode 100644
index 0000000..77ce66e
--- /dev/null
+++ b/playback/player/android/build.gradle
@@ -0,0 +1,23 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:2.1.3'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/playback/player/android/gradle.properties b/playback/player/android/gradle.properties
new file mode 100644
index 0000000..1d3591c
--- /dev/null
+++ b/playback/player/android/gradle.properties
@@ -0,0 +1,18 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# Default value: -Xmx10248m -XX:MaxPermSize=256m
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true \ No newline at end of file
diff --git a/playback/player/android/gradle/wrapper/gradle-wrapper.jar b/playback/player/android/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..05ef575
--- /dev/null
+++ b/playback/player/android/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/playback/player/android/gradle/wrapper/gradle-wrapper.properties b/playback/player/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..fc500fd
--- /dev/null
+++ b/playback/player/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue Aug 23 11:07:06 IST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
diff --git a/playback/player/android/gradlew b/playback/player/android/gradlew
new file mode 100755
index 0000000..9d82f78
--- /dev/null
+++ b/playback/player/android/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/playback/player/android/gradlew.bat b/playback/player/android/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/playback/player/android/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/playback/player/android/settings.gradle b/playback/player/android/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/playback/player/android/settings.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/playback/player/gst-play/Makefile.am b/playback/player/gst-play/Makefile.am
new file mode 100644
index 0000000..184e8c1
--- /dev/null
+++ b/playback/player/gst-play/Makefile.am
@@ -0,0 +1,9 @@
+bin_PROGRAMS = gst-play
+
+gst_play_SOURCES = gst-play.c gst-play-kb.c gst-play-kb.h
+
+LDADD = $(GSTREAMER_LIBS) $(GLIB_LIBS) $(LIBM)
+
+AM_CFLAGS = $(GSTREAMER_CFLAGS) $(GLIB_CFLAGS) $(WARNING_CFLAGS)
+
+noinst_HEADERS = gst-play-kb.h
diff --git a/playback/player/gst-play/gst-play-kb.c b/playback/player/gst-play/gst-play-kb.c
new file mode 100644
index 0000000..791269d
--- /dev/null
+++ b/playback/player/gst-play/gst-play-kb.c
@@ -0,0 +1,143 @@
+/* GStreamer command line playback testing utility - keyboard handling helpers
+ *
+ * Copyright (C) 2013 Tim-Philipp Müller <tim centricular net>
+ * Copyright (C) 2013 Centricular Ltd
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "gst-play-kb.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#ifdef G_OS_UNIX
+#include <unistd.h>
+#include <termios.h>
+#endif
+
+#include <gst/gst.h>
+
+/* This is all not thread-safe, but doesn't have to be really */
+
+#ifdef G_OS_UNIX
+
+static struct termios term_settings;
+static gboolean term_settings_saved = FALSE;
+static GstPlayKbFunc kb_callback;
+static gpointer kb_callback_data;
+static gulong io_watch_id;
+
+static gboolean
+gst_play_kb_io_cb (GIOChannel * ioc, GIOCondition cond, gpointer user_data)
+{
+ GIOStatus status;
+
+ if (cond & G_IO_IN) {
+ gchar buf[16] = { 0, };
+ gsize read;
+
+ status = g_io_channel_read_chars (ioc, buf, sizeof (buf) - 1, &read, NULL);
+ if (status == G_IO_STATUS_ERROR)
+ return FALSE;
+ if (status == G_IO_STATUS_NORMAL) {
+ if (kb_callback)
+ kb_callback (buf, kb_callback_data);
+ }
+ }
+
+ return TRUE; /* call us again */
+}
+
+gboolean
+gst_play_kb_set_key_handler (GstPlayKbFunc kb_func, gpointer user_data)
+{
+ GIOChannel *ioc;
+ int flags;
+
+ if (!isatty (STDIN_FILENO)) {
+ GST_INFO ("stdin is not connected to a terminal");
+ return FALSE;
+ }
+
+ if (io_watch_id > 0) {
+ g_source_remove (io_watch_id);
+ io_watch_id = 0;
+ }
+
+ if (kb_func == NULL && term_settings_saved) {
+ /* restore terminal settings */
+ if (tcsetattr (STDIN_FILENO, TCSAFLUSH, &term_settings) == 0)
+ term_settings_saved = FALSE;
+ else
+ g_warning ("could not restore terminal attributes");
+
+ setvbuf (stdin, NULL, _IOLBF, 0);
+ }
+
+ if (kb_func != NULL) {
+ struct termios new_settings;
+
+ if (!term_settings_saved) {
+ if (tcgetattr (STDIN_FILENO, &term_settings) != 0) {
+ g_warning ("could not save terminal attributes");
+ return FALSE;
+ }
+ term_settings_saved = TRUE;
+
+ /* Echo off, canonical mode off, extended input processing off */
+ new_settings = term_settings;
+ new_settings.c_lflag &= ~(ECHO | ICANON | IEXTEN);
+
+ if (tcsetattr (STDIN_FILENO, TCSAFLUSH, &new_settings) != 0) {
+ g_warning ("Could not set terminal state");
+ return FALSE;
+ }
+ setvbuf (stdin, NULL, _IONBF, 0);
+ }
+ }
+
+ ioc = g_io_channel_unix_new (STDIN_FILENO);
+
+ /* make non-blocking */
+ flags = g_io_channel_get_flags (ioc);
+ g_io_channel_set_flags (ioc, flags | G_IO_FLAG_NONBLOCK, NULL);
+
+ io_watch_id = g_io_add_watch_full (ioc, G_PRIORITY_DEFAULT, G_IO_IN,
+ (GIOFunc) gst_play_kb_io_cb, user_data, NULL);
+ g_io_channel_unref (ioc);
+
+ kb_callback = kb_func;
+ kb_callback_data = user_data;
+
+ return TRUE;
+}
+
+#else /* !G_OS_UNIX */
+
+gboolean
+gst_play_kb_set_key_handler (GstPlayKbFunc key_func, gpointer user_data)
+{
+ GST_FIXME ("Keyboard handling for this OS needs to be implemented");
+ return FALSE;
+}
+
+#endif /* !G_OS_UNIX */
diff --git a/playback/player/gst-play/gst-play-kb.h b/playback/player/gst-play/gst-play-kb.h
new file mode 100644
index 0000000..7dab0ed
--- /dev/null
+++ b/playback/player/gst-play/gst-play-kb.h
@@ -0,0 +1,35 @@
+/* GStreamer command line playback testing utility - keyboard handling helpers
+ *
+ * Copyright (C) 2013 Tim-Philipp Müller <tim centricular net>
+ * Copyright (C) 2013 Centricular Ltd
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+#ifndef __GST_PLAY_KB_INCLUDED__
+#define __GST_PLAY_KB_INCLUDED__
+
+#include <glib.h>
+
+#define GST_PLAY_KB_ARROW_UP "\033[A"
+#define GST_PLAY_KB_ARROW_DOWN "\033[B"
+#define GST_PLAY_KB_ARROW_RIGHT "\033[C"
+#define GST_PLAY_KB_ARROW_LEFT "\033[D"
+
+typedef void (*GstPlayKbFunc) (const gchar * kb_input, gpointer user_data);
+
+gboolean gst_play_kb_set_key_handler (GstPlayKbFunc kb_func, gpointer user_data);
+
+#endif /* __GST_PLAY_KB_INCLUDED__ */
diff --git a/playback/player/gst-play/gst-play.c b/playback/player/gst-play/gst-play.c
new file mode 100644
index 0000000..bd21bd2
--- /dev/null
+++ b/playback/player/gst-play/gst-play.c
@@ -0,0 +1,773 @@
+/* GStreamer command line playback testing utility
+ *
+ * Copyright (C) 2013-2014 Tim-Philipp Müller <tim centricular net>
+ * Copyright (C) 2013 Collabora Ltd.
+ * Copyright (C) 2014 Sebastian Dröge <sebastian@centricular.com>
+ * Copyright (C) 2015 Brijesh Singh <brijesh.ksingh@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <locale.h>
+
+#include <gst/gst.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+#include "gst-play-kb.h"
+#include <gst/player/player.h>
+
+#define VOLUME_STEPS 20
+
+GST_DEBUG_CATEGORY (play_debug);
+#define GST_CAT_DEFAULT play_debug
+
+typedef struct
+{
+ gchar **uris;
+ guint num_uris;
+ gint cur_idx;
+
+ GstPlayer *player;
+ GstState desired_state;
+
+ gboolean repeat;
+
+ GMainLoop *loop;
+} GstPlay;
+
+static gboolean play_next (GstPlay * play);
+static gboolean play_prev (GstPlay * play);
+static void play_reset (GstPlay * play);
+static void play_set_relative_volume (GstPlay * play, gdouble volume_step);
+
+static void
+end_of_stream_cb (GstPlayer * player, GstPlay * play)
+{
+ g_print ("\n");
+ /* and switch to next item in list */
+ if (!play_next (play)) {
+ g_print ("Reached end of play list.\n");
+ g_main_loop_quit (play->loop);
+ }
+}
+
+static void
+error_cb (GstPlayer * player, GError * err, GstPlay * play)
+{
+ g_printerr ("ERROR %s for %s\n", err->message, play->uris[play->cur_idx]);
+
+ /* if looping is enabled, then disable it else will keep looping forever */
+ play->repeat = FALSE;
+
+ /* try next item in list then */
+ if (!play_next (play)) {
+ g_print ("Reached end of play list.\n");
+ g_main_loop_quit (play->loop);
+ }
+}
+
+static void
+position_updated_cb (GstPlayer * player, GstClockTime pos, GstPlay * play)
+{
+ GstClockTime dur = -1;
+ gchar status[64] = { 0, };
+
+ g_object_get (play->player, "duration", &dur, NULL);
+
+ memset (status, ' ', sizeof (status) - 1);
+
+ if (pos != -1 && dur > 0 && dur != -1) {
+ gchar dstr[32], pstr[32];
+
+ /* FIXME: pretty print in nicer format */
+ g_snprintf (pstr, 32, "%" GST_TIME_FORMAT, GST_TIME_ARGS (pos));
+ pstr[9] = '\0';
+ g_snprintf (dstr, 32, "%" GST_TIME_FORMAT, GST_TIME_ARGS (dur));
+ dstr[9] = '\0';
+ g_print ("%s / %s %s\r", pstr, dstr, status);
+ }
+}
+
+static void
+state_changed_cb (GstPlayer * player, GstPlayerState state, GstPlay * play)
+{
+ g_print ("State changed: %s\n", gst_player_state_get_name (state));
+}
+
+static void
+buffering_cb (GstPlayer * player, gint percent, GstPlay * play)
+{
+ g_print ("Buffering: %d\n", percent);
+}
+
+static void
+print_one_tag (const GstTagList * list, const gchar * tag, gpointer user_data)
+{
+ gint i, num;
+
+ num = gst_tag_list_get_tag_size (list, tag);
+ for (i = 0; i < num; ++i) {
+ const GValue *val;
+
+ val = gst_tag_list_get_value_index (list, tag, i);
+ if (G_VALUE_HOLDS_STRING (val)) {
+ g_print (" %s : %s \n", tag, g_value_get_string (val));
+ } else if (G_VALUE_HOLDS_UINT (val)) {
+ g_print (" %s : %u \n", tag, g_value_get_uint (val));
+ } else if (G_VALUE_HOLDS_DOUBLE (val)) {
+ g_print (" %s : %g \n", tag, g_value_get_double (val));
+ } else if (G_VALUE_HOLDS_BOOLEAN (val)) {
+ g_print (" %s : %s \n", tag,
+ g_value_get_boolean (val) ? "true" : "false");
+ } else if (GST_VALUE_HOLDS_DATE_TIME (val)) {
+ GstDateTime *dt = g_value_get_boxed (val);
+ gchar *dt_str = gst_date_time_to_iso8601_string (dt);
+
+ g_print (" %s : %s \n", tag, dt_str);
+ g_free (dt_str);
+ } else {
+ g_print (" %s : tag of type '%s' \n", tag, G_VALUE_TYPE_NAME (val));
+ }
+ }
+}
+
+static void
+print_video_info (GstPlayerVideoInfo * info)
+{
+ gint fps_n, fps_d;
+ guint par_n, par_d;
+
+ if (info == NULL)
+ return;
+
+ g_print (" width : %d\n", gst_player_video_info_get_width (info));
+ g_print (" height : %d\n", gst_player_video_info_get_height (info));
+ g_print (" max_bitrate : %d\n",
+ gst_player_video_info_get_max_bitrate (info));
+ g_print (" bitrate : %d\n", gst_player_video_info_get_bitrate (info));
+ gst_player_video_info_get_framerate (info, &fps_n, &fps_d);
+ g_print (" framerate : %.2f\n", (gdouble) fps_n / fps_d);
+ gst_player_video_info_get_pixel_aspect_ratio (info, &par_n, &par_d);
+ g_print (" pixel-aspect-ratio %u:%u\n", par_n, par_d);
+}
+
+static void
+print_audio_info (GstPlayerAudioInfo * info)
+{
+ if (info == NULL)
+ return;
+
+ g_print (" sample rate : %d\n",
+ gst_player_audio_info_get_sample_rate (info));
+ g_print (" channels : %d\n", gst_player_audio_info_get_channels (info));
+ g_print (" max_bitrate : %d\n",
+ gst_player_audio_info_get_max_bitrate (info));
+ g_print (" bitrate : %d\n", gst_player_audio_info_get_bitrate (info));
+ g_print (" language : %s\n", gst_player_audio_info_get_language (info));
+}
+
+static void
+print_subtitle_info (GstPlayerSubtitleInfo * info)
+{
+ if (info == NULL)
+ return;
+
+ g_print (" language : %s\n", gst_player_subtitle_info_get_language (info));
+}
+
+static void
+print_all_stream_info (GstPlayerMediaInfo * media_info)
+{
+ guint count = 0;
+ GList *list, *l;
+
+ g_print ("URI : %s\n", gst_player_media_info_get_uri (media_info));
+ g_print ("Duration: %" GST_TIME_FORMAT "\n",
+ GST_TIME_ARGS (gst_player_media_info_get_duration (media_info)));
+ g_print ("Global taglist:\n");
+ if (gst_player_media_info_get_tags (media_info))
+ gst_tag_list_foreach (gst_player_media_info_get_tags (media_info),
+ print_one_tag, NULL);
+ else
+ g_print (" (nil) \n");
+
+ list = gst_player_media_info_get_stream_list (media_info);
+ if (!list)
+ return;
+
+ g_print ("All Stream information\n");
+ for (l = list; l != NULL; l = l->next) {
+ GstTagList *tags = NULL;
+ GstPlayerStreamInfo *stream = (GstPlayerStreamInfo *) l->data;
+
+ g_print (" Stream # %u \n", count++);
+ g_print (" type : %s_%u\n",
+ gst_player_stream_info_get_stream_type (stream),
+ gst_player_stream_info_get_index (stream));
+ tags = gst_player_stream_info_get_tags (stream);
+ g_print (" taglist : \n");
+ if (tags) {
+ gst_tag_list_foreach (tags, print_one_tag, NULL);
+ }
+
+ if (GST_IS_PLAYER_VIDEO_INFO (stream))
+ print_video_info ((GstPlayerVideoInfo *) stream);
+ else if (GST_IS_PLAYER_AUDIO_INFO (stream))
+ print_audio_info ((GstPlayerAudioInfo *) stream);
+ else
+ print_subtitle_info ((GstPlayerSubtitleInfo *) stream);
+ }
+}
+
+static void
+print_all_video_stream (GstPlayerMediaInfo * media_info)
+{
+ GList *list, *l;
+
+ list = gst_player_get_video_streams (media_info);
+ if (!list)
+ return;
+
+ g_print ("All video streams\n");
+ for (l = list; l != NULL; l = l->next) {
+ GstPlayerVideoInfo *info = (GstPlayerVideoInfo *) l->data;
+ GstPlayerStreamInfo *sinfo = (GstPlayerStreamInfo *) info;
+ g_print (" %s_%d #\n", gst_player_stream_info_get_stream_type (sinfo),
+ gst_player_stream_info_get_index (sinfo));
+ print_video_info (info);
+ }
+}
+
+static void
+print_all_subtitle_stream (GstPlayerMediaInfo * media_info)
+{
+ GList *list, *l;
+
+ list = gst_player_get_subtitle_streams (media_info);
+ if (!list)
+ return;
+
+ g_print ("All subtitle streams:\n");
+ for (l = list; l != NULL; l = l->next) {
+ GstPlayerSubtitleInfo *info = (GstPlayerSubtitleInfo *) l->data;
+ GstPlayerStreamInfo *sinfo = (GstPlayerStreamInfo *) info;
+ g_print (" %s_%d #\n", gst_player_stream_info_get_stream_type (sinfo),
+ gst_player_stream_info_get_index (sinfo));
+ print_subtitle_info (info);
+ }
+}
+
+static void
+print_all_audio_stream (GstPlayerMediaInfo * media_info)
+{
+ GList *list, *l;
+
+ list = gst_player_get_audio_streams (media_info);
+ if (!list)
+ return;
+
+ g_print ("All audio streams: \n");
+ for (l = list; l != NULL; l = l->next) {
+ GstPlayerAudioInfo *info = (GstPlayerAudioInfo *) l->data;
+ GstPlayerStreamInfo *sinfo = (GstPlayerStreamInfo *) info;
+ g_print (" %s_%d #\n", gst_player_stream_info_get_stream_type (sinfo),
+ gst_player_stream_info_get_index (sinfo));
+ print_audio_info (info);
+ }
+}
+
+static void
+print_current_tracks (GstPlay * play)
+{
+ GstPlayerAudioInfo *audio = NULL;
+ GstPlayerVideoInfo *video = NULL;
+ GstPlayerSubtitleInfo *subtitle = NULL;
+
+ g_print ("Current video track: \n");
+ video = gst_player_get_current_video_track (play->player);
+ print_video_info (video);
+
+ g_print ("Current audio track: \n");
+ audio = gst_player_get_current_audio_track (play->player);
+ print_audio_info (audio);
+
+ g_print ("Current subtitle track: \n");
+ subtitle = gst_player_get_current_subtitle_track (play->player);
+ print_subtitle_info (subtitle);
+
+ if (audio)
+ g_object_unref (audio);
+
+ if (video)
+ g_object_unref (video);
+
+ if (subtitle)
+ g_object_unref (subtitle);
+}
+
+static void
+print_media_info (GstPlayerMediaInfo * media_info)
+{
+ print_all_stream_info (media_info);
+ g_print ("\n");
+ print_all_video_stream (media_info);
+ g_print ("\n");
+ print_all_audio_stream (media_info);
+ g_print ("\n");
+ print_all_subtitle_stream (media_info);
+}
+
+static void
+media_info_cb (GstPlayer * player, GstPlayerMediaInfo * info, GstPlay * play)
+{
+ static int once = 0;
+
+ if (!once) {
+ print_media_info (info);
+ print_current_tracks (play);
+ once = 1;
+ }
+}
+
+static GstPlay *
+play_new (gchar ** uris, gdouble initial_volume)
+{
+ GstPlay *play;
+
+ play = g_new0 (GstPlay, 1);
+
+ play->uris = uris;
+ play->num_uris = g_strv_length (uris);
+ play->cur_idx = -1;
+
+ play->player =
+ gst_player_new (NULL, gst_player_g_main_context_signal_dispatcher_new
+ (NULL));
+
+ g_signal_connect (play->player, "position-updated",
+ G_CALLBACK (position_updated_cb), play);
+ g_signal_connect (play->player, "state-changed",
+ G_CALLBACK (state_changed_cb), play);
+ g_signal_connect (play->player, "buffering", G_CALLBACK (buffering_cb), play);
+ g_signal_connect (play->player, "end-of-stream",
+ G_CALLBACK (end_of_stream_cb), play);
+ g_signal_connect (play->player, "error", G_CALLBACK (error_cb), play);
+
+ g_signal_connect (play->player, "media-info-updated",
+ G_CALLBACK (media_info_cb), play);
+
+ play->loop = g_main_loop_new (NULL, FALSE);
+ play->desired_state = GST_STATE_PLAYING;
+
+ play_set_relative_volume (play, initial_volume - 1.0);
+
+ return play;
+}
+
+static void
+play_free (GstPlay * play)
+{
+ play_reset (play);
+
+ gst_object_unref (play->player);
+
+ g_main_loop_unref (play->loop);
+
+ g_strfreev (play->uris);
+ g_free (play);
+}
+
+/* reset for new file/stream */
+static void
+play_reset (GstPlay * play)
+{
+}
+
+static void
+play_set_relative_volume (GstPlay * play, gdouble volume_step)
+{
+ gdouble volume;
+
+ g_object_get (play->player, "volume", &volume, NULL);
+ volume = round ((volume + volume_step) * VOLUME_STEPS) / VOLUME_STEPS;
+ volume = CLAMP (volume, 0.0, 10.0);
+
+ g_object_set (play->player, "volume", volume, NULL);
+
+ g_print ("Volume: %.0f%% \n", volume * 100);
+}
+
+static gchar *
+play_uri_get_display_name (GstPlay * play, const gchar * uri)
+{
+ gchar *loc;
+
+ if (gst_uri_has_protocol (uri, "file")) {
+ loc = g_filename_from_uri (uri, NULL, NULL);
+ } else if (gst_uri_has_protocol (uri, "pushfile")) {
+ loc = g_filename_from_uri (uri + 4, NULL, NULL);
+ } else {
+ loc = g_strdup (uri);
+ }
+
+ /* Maybe additionally use glib's filename to display name function */
+ return loc;
+}
+
+static void
+play_uri (GstPlay * play, const gchar * next_uri)
+{
+ gchar *loc;
+
+ play_reset (play);
+
+ loc = play_uri_get_display_name (play, next_uri);
+ g_print ("Now playing %s\n", loc);
+ g_free (loc);
+
+ g_object_set (play->player, "uri", next_uri, NULL);
+ gst_player_play (play->player);
+}
+
+/* returns FALSE if we have reached the end of the playlist */
+static gboolean
+play_next (GstPlay * play)
+{
+ if ((play->cur_idx + 1) >= play->num_uris) {
+ if (play->repeat) {
+ g_print ("Looping playlist \n");
+ play->cur_idx = -1;
+ } else
+ return FALSE;
+ }
+
+ play_uri (play, play->uris[++play->cur_idx]);
+ return TRUE;
+}
+
+/* returns FALSE if we have reached the beginning of the playlist */
+static gboolean
+play_prev (GstPlay * play)
+{
+ if (play->cur_idx == 0 || play->num_uris <= 1)
+ return FALSE;
+
+ play_uri (play, play->uris[--play->cur_idx]);
+ return TRUE;
+}
+
+static void
+do_play (GstPlay * play)
+{
+ gint i;
+
+ /* dump playlist */
+ for (i = 0; i < play->num_uris; ++i)
+ GST_INFO ("%4u : %s", i, play->uris[i]);
+
+ if (!play_next (play))
+ return;
+
+ g_main_loop_run (play->loop);
+}
+
+static void
+add_to_playlist (GPtrArray * playlist, const gchar * filename)
+{
+ GDir *dir;
+ gchar *uri;
+
+ if (gst_uri_is_valid (filename)) {
+ g_ptr_array_add (playlist, g_strdup (filename));
+ return;
+ }
+
+ if ((dir = g_dir_open (filename, 0, NULL))) {
+ const gchar *entry;
+
+ /* FIXME: sort entries for each directory? */
+ while ((entry = g_dir_read_name (dir))) {
+ gchar *path;
+
+ path = g_strconcat (filename, G_DIR_SEPARATOR_S, entry, NULL);
+ add_to_playlist (playlist, path);
+ g_free (path);
+ }
+
+ g_dir_close (dir);
+ return;
+ }
+
+ uri = gst_filename_to_uri (filename, NULL);
+ if (uri != NULL)
+ g_ptr_array_add (playlist, uri);
+ else
+ g_warning ("Could not make URI out of filename '%s'", filename);
+}
+
+static void
+shuffle_uris (gchar ** uris, guint num)
+{
+ gchar *tmp;
+ guint i, j;
+
+ if (num < 2)
+ return;
+
+ for (i = 0; i < num; i++) {
+ /* gets equally distributed random number in 0..num-1 [0;num[ */
+ j = g_random_int_range (0, num);
+ tmp = uris[j];
+ uris[j] = uris[i];
+ uris[i] = tmp;
+ }
+}
+
+static void
+restore_terminal (void)
+{
+ gst_play_kb_set_key_handler (NULL, NULL);
+}
+
+static void
+toggle_paused (GstPlay * play)
+{
+ if (play->desired_state == GST_STATE_PLAYING) {
+ play->desired_state = GST_STATE_PAUSED;
+ gst_player_pause (play->player);
+ } else {
+ play->desired_state = GST_STATE_PLAYING;
+ gst_player_play (play->player);
+ }
+}
+
+static void
+relative_seek (GstPlay * play, gdouble percent)
+{
+ gint64 dur = -1, pos = -1;
+
+ g_return_if_fail (percent >= -1.0 && percent <= 1.0);
+
+ g_object_get (play->player, "position", &pos, "duration", &dur, NULL);
+
+ if (dur <= 0) {
+ g_print ("\nCould not seek.\n");
+ return;
+ }
+
+ pos = pos + dur * percent;
+ if (pos < 0)
+ pos = 0;
+ gst_player_seek (play->player, pos);
+}
+
+static void
+keyboard_cb (const gchar * key_input, gpointer user_data)
+{
+ GstPlay *play = (GstPlay *) user_data;
+
+ switch (g_ascii_tolower (key_input[0])) {
+ case 'i':
+ {
+ GstPlayerMediaInfo *media_info = gst_player_get_media_info (play->player);
+ if (media_info) {
+ print_media_info (media_info);
+ g_object_unref (media_info);
+ print_current_tracks (play);
+ }
+ break;
+ }
+ case ' ':
+ toggle_paused (play);
+ break;
+ case 'q':
+ case 'Q':
+ g_main_loop_quit (play->loop);
+ break;
+ case '>':
+ if (!play_next (play)) {
+ g_print ("\nReached end of play list.\n");
+ g_main_loop_quit (play->loop);
+ }
+ break;
+ case '<':
+ play_prev (play);
+ break;
+ case 27: /* ESC */
+ if (key_input[1] == '\0') {
+ g_main_loop_quit (play->loop);
+ break;
+ }
+ /* fall through */
+ default:
+ if (strcmp (key_input, GST_PLAY_KB_ARROW_RIGHT) == 0) {
+ relative_seek (play, +0.08);
+ } else if (strcmp (key_input, GST_PLAY_KB_ARROW_LEFT) == 0) {
+ relative_seek (play, -0.01);
+ } else if (strcmp (key_input, GST_PLAY_KB_ARROW_UP) == 0) {
+ play_set_relative_volume (play, +1.0 / VOLUME_STEPS);
+ } else if (strcmp (key_input, GST_PLAY_KB_ARROW_DOWN) == 0) {
+ play_set_relative_volume (play, -1.0 / VOLUME_STEPS);
+ } else {
+ GST_INFO ("keyboard input:");
+ for (; *key_input != '\0'; ++key_input)
+ GST_INFO (" code %3d", *key_input);
+ }
+ break;
+ }
+}
+
+int
+main (int argc, char **argv)
+{
+ GstPlay *play;
+ GPtrArray *playlist;
+ gboolean print_version = FALSE;
+ gboolean interactive = FALSE; /* FIXME: maybe enable by default? */
+ gboolean shuffle = FALSE;
+ gboolean repeat = FALSE;
+ gdouble volume = 1.0;
+ gchar **filenames = NULL;
+ gchar **uris;
+ guint num, i;
+ GError *err = NULL;
+ GOptionContext *ctx;
+ gchar *playlist_file = NULL;
+ GOptionEntry options[] = {
+ {"version", 0, 0, G_OPTION_ARG_NONE, &print_version,
+ "Print version information and exit", NULL},
+ {"shuffle", 0, 0, G_OPTION_ARG_NONE, &shuffle,
+ "Shuffle playlist", NULL},
+ {"interactive", 0, 0, G_OPTION_ARG_NONE, &interactive,
+ "Interactive control via keyboard", NULL},
+ {"volume", 0, 0, G_OPTION_ARG_DOUBLE, &volume,
+ "Volume", NULL},
+ {"playlist", 0, 0, G_OPTION_ARG_FILENAME, &playlist_file,
+ "Playlist file containing input media files", NULL},
+ {"loop", 0, 0, G_OPTION_ARG_NONE, &repeat, "Repeat all", NULL},
+ {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames, NULL},
+ {NULL}
+ };
+
+ g_set_prgname ("gst-play");
+
+ ctx = g_option_context_new ("FILE1|URI1 [FILE2|URI2] [FILE3|URI3] ...");
+ g_option_context_add_main_entries (ctx, options, NULL);
+ g_option_context_add_group (ctx, gst_init_get_option_group ());
+ if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
+ g_print ("Error initializing: %s\n", GST_STR_NULL (err->message));
+ g_clear_error (&err);
+ g_option_context_free (ctx);
+ return 1;
+ }
+ g_option_context_free (ctx);
+
+ GST_DEBUG_CATEGORY_INIT (play_debug, "play", 0, "gst-play");
+
+ if (print_version) {
+ gchar *version_str;
+
+ version_str = gst_version_string ();
+ g_print ("%s version %s\n", g_get_prgname (), "1.0");
+ g_print ("%s\n", version_str);
+ g_free (version_str);
+
+ g_free (playlist_file);
+
+ return 0;
+ }
+
+ playlist = g_ptr_array_new ();
+
+ if (playlist_file != NULL) {
+ gchar *playlist_contents = NULL;
+ gchar **lines = NULL;
+
+ if (g_file_get_contents (playlist_file, &playlist_contents, NULL, &err)) {
+ lines = g_strsplit (playlist_contents, "\n", 0);
+ num = g_strv_length (lines);
+
+ for (i = 0; i < num; i++) {
+ if (lines[i][0] != '\0') {
+ GST_LOG ("Playlist[%d]: %s", i + 1, lines[i]);
+ add_to_playlist (playlist, lines[i]);
+ }
+ }
+ g_strfreev (lines);
+ g_free (playlist_contents);
+ } else {
+ g_printerr ("Could not read playlist: %s\n", err->message);
+ g_clear_error (&err);
+ }
+ g_free (playlist_file);
+ playlist_file = NULL;
+ }
+
+ if (playlist->len == 0 && (filenames == NULL || *filenames == NULL)) {
+ g_printerr ("Usage: %s FILE1|URI1 [FILE2|URI2] [FILE3|URI3] ...",
+ "gst-play");
+ g_printerr ("\n\n"),
+ g_printerr ("%s\n\n",
+ "You must provide at least one filename or URI to play.");
+ /* No input provided. Free array */
+ g_ptr_array_free (playlist, TRUE);
+
+ return 1;
+ }
+
+ /* fill playlist */
+ if (filenames != NULL && *filenames != NULL) {
+ num = g_strv_length (filenames);
+ for (i = 0; i < num; ++i) {
+ GST_LOG ("command line argument: %s", filenames[i]);
+ add_to_playlist (playlist, filenames[i]);
+ }
+ g_strfreev (filenames);
+ }
+
+ num = playlist->len;
+ g_ptr_array_add (playlist, NULL);
+
+ uris = (gchar **) g_ptr_array_free (playlist, FALSE);
+
+ if (shuffle)
+ shuffle_uris (uris, num);
+
+ /* prepare */
+ play = play_new (uris, volume);
+ play->repeat = repeat;
+
+ if (interactive) {
+ if (gst_play_kb_set_key_handler (keyboard_cb, play)) {
+ atexit (restore_terminal);
+ } else {
+ g_print ("Interactive keyboard handling in terminal not available.\n");
+ }
+ }
+
+ /* play */
+ do_play (play);
+
+ /* clean up */
+ play_free (play);
+
+ g_print ("\n");
+ gst_deinit ();
+ return 0;
+}
diff --git a/playback/player/gtk/Makefile.am b/playback/player/gtk/Makefile.am
new file mode 100644
index 0000000..45623e5
--- /dev/null
+++ b/playback/player/gtk/Makefile.am
@@ -0,0 +1,35 @@
+bin_PROGRAMS = gtk-play
+
+gtk-play-resources.c: resources/gresources.xml \
+ resources/media_info_dialog.ui \
+ resources/toolbar.css \
+ resources/toolbar.ui
+ $(AM_V_GEN) \
+ glib-compile-resources \
+ --sourcedir=$(srcdir)/resources \
+ --target=$@ \
+ --generate-source \
+ --c-name as \
+ $(srcdir)/resources/gresources.xml
+
+gtk-play-resources.h: resources/gresources.xml \
+ resources/media_info_dialog.ui \
+ resources/toolbar.css \
+ resources/toolbar.ui
+ $(AM_V_GEN) \
+ glib-compile-resources \
+ --sourcedir=$(srcdir)/resources \
+ --target=$@ \
+ --generate-header \
+ --c-name as \
+ $(srcdir)/resources/gresources.xml
+
+BUILT_SOURCES: gtk-play-resources.c gtk-play-resources.h
+
+gtk_play_SOURCES = gtk-play.c gtk-play-resources.c gtk-video-renderer.c
+
+LDADD = $(GSTREAMER_LIBS) $(GTK_LIBS) $(GTK_X11_LIBS) $(GLIB_LIBS) $(LIBM) $(GMODULE_LIBS)
+
+AM_CFLAGS = $(GSTREAMER_CFLAGS) $(GTK_CFLAGS) $(GTK_X11_CFLAGS) $(GLIB_CFLAGS) $(GMODULE_CFLAGS) $(WARNING_CFLAGS)
+
+noinst_HEADERS = gtk-play-resources.h gtk-video-renderer.h
diff --git a/playback/player/gtk/gtk-play.c b/playback/player/gtk/gtk-play.c
new file mode 100644
index 0000000..8ae0fea
--- /dev/null
+++ b/playback/player/gtk/gtk-play.c
@@ -0,0 +1,1918 @@
+/* GStreamer
+ *
+ * Copyright (C) 2014-2015 Sebastian Dröge <sebastian@centricular.com>
+ * Copyright (C) 2015 Brijesh Singh <brijesh.ksingh@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <string.h>
+#include <math.h>
+
+#include <gst/gst.h>
+#include <gst/tag/tag.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+#include <gdk/gdk.h>
+#if defined (GDK_WINDOWING_X11)
+#include <gdk/gdkx.h>
+#elif defined (GDK_WINDOWING_WIN32)
+#include <gdk/gdkwin32.h>
+#elif defined (GDK_WINDOWING_QUARTZ)
+#include <gdk/gdkquartz.h>
+#endif
+
+#include <gtk/gtk.h>
+
+#include <gst/player/player.h>
+#include "gtk-video-renderer.h"
+
+#define APP_NAME "gtk-play"
+
+#define TOOLBAR_GET_OBJECT(x) \
+ (GtkWidget *)gtk_builder_get_object (play->toolbar_ui, #x)
+
+#define TOOLBAR_GET_LABEL(x) \
+ (GtkLabel *) gtk_builder_get_object (play->toolbar_ui, #x)
+
+typedef GtkApplication GtkPlayApp;
+typedef GtkApplicationClass GtkPlayAppClass;
+
+GType gtk_play_app_get_type (void);
+G_DEFINE_TYPE (GtkPlayApp, gtk_play_app, GTK_TYPE_APPLICATION);
+
+typedef struct
+{
+ GtkApplicationWindow parent;
+
+ GstPlayer *player;
+ GstPlayerVideoRenderer *renderer;
+
+ GList *uris;
+ GList *current_uri;
+
+ guint inhibit_cookie;
+
+ GtkWidget *play_pause_button;
+ GtkWidget *prev_button, *next_button;
+ GtkWidget *seekbar;
+ GtkWidget *video_area;
+ GtkWidget *volume_button;
+ GtkWidget *fullscreen_button;
+ GtkWidget *toolbar;
+ GtkWidget *toolbar_overlay;
+ GtkWidget *media_info_dialog;
+ GtkLabel *title_label;
+ GtkLabel *elapshed_label;
+ GtkLabel *remain_label;
+ GtkLabel *rate_label;
+ GdkCursor *default_cursor;
+ gboolean playing;
+ gboolean loop;
+ gboolean fullscreen;
+ gint toolbar_hide_timeout;
+
+ GtkBuilder *toolbar_ui;
+} GtkPlay;
+
+typedef GtkApplicationWindowClass GtkPlayClass;
+
+GType gtk_play_get_type (void);
+G_DEFINE_TYPE (GtkPlay, gtk_play, GTK_TYPE_APPLICATION_WINDOW);
+
+void rewind_button_clicked_cb (GtkButton * button, GtkPlay * play);
+void forward_button_clicked_cb (GtkButton * button, GtkPlay * play);
+void play_pause_button_clicked_cb (GtkButton * button, GtkPlay * play);
+void prev_button_clicked_cb (GtkButton * button, GtkPlay * play);
+void next_button_clicked_cb (GtkButton * button, GtkPlay * play);
+void media_info_dialog_button_clicked_cb (GtkButton * button, GtkPlay * play);
+void fullscreen_button_toggled_cb (GtkToggleButton * widget, GtkPlay * play);
+void seekbar_value_changed_cb (GtkRange * range, GtkPlay * play);
+void volume_button_value_changed_cb (GtkScaleButton * button, gdouble value,
+ GtkPlay * play);
+
+enum
+{
+ PROP_0,
+ PROP_LOOP,
+ PROP_FULLSCREEN,
+ PROP_URIS,
+
+ LAST_PROP
+};
+
+static GParamSpec *gtk_play_properties[LAST_PROP] = { NULL, };
+
+enum
+{
+ COL_TEXT = 0,
+ COL_NUM
+};
+
+enum
+{
+ VIDEO_INFO_START,
+ VIDEO_INFO_RESOLUTION,
+ VIDEO_INFO_FPS,
+ VIDEO_INFO_PAR,
+ VIDEO_INFO_CODEC,
+ VIDEO_INFO_MAX_BITRATE,
+ VIDEO_INFO_END,
+ AUDIO_INFO_START,
+ AUDIO_INFO_CHANNELS,
+ AUDIO_INFO_RATE,
+ AUDIO_INFO_LANGUAGE,
+ AUDIO_INFO_CODEC,
+ AUDIO_INFO_MAX_BITRATE,
+ AUDIO_INFO_END,
+ SUBTITLE_INFO_START,
+ SUBTITLE_INFO_LANGUAGE,
+ SUBTITLE_INFO_CODEC,
+ SUBTITLE_INFO_END,
+};
+
+static void
+set_title (GtkPlay * play, const gchar * title)
+{
+ if (title == NULL) {
+ gtk_window_set_title (GTK_WINDOW (play), APP_NAME);
+ } else {
+ gtk_window_set_title (GTK_WINDOW (play), title);
+ }
+}
+
+static GtkBuilder *
+load_from_builder (const gchar * filename, gboolean register_sig_handler,
+ GtkPlay * play)
+{
+ GtkBuilder *builder;
+
+ builder = gtk_builder_new_from_resource (filename);
+ if (builder == NULL) {
+ g_print ("ERROR: failed to load %s \n", filename);
+ return NULL;
+ }
+
+ if (register_sig_handler)
+ gtk_builder_connect_signals (builder, play);
+
+ return builder;
+}
+
+
+static void
+delete_event_cb (GtkWidget * widget, GdkEvent * event, GtkPlay * play)
+{
+ gtk_widget_destroy (GTK_WIDGET (play));
+}
+
+static void
+video_area_realize_cb (GtkWidget * widget, GtkPlay * play)
+{
+ GdkWindow *window = gtk_widget_get_window (widget);
+ guintptr window_handle;
+
+ if (!gdk_window_ensure_native (window))
+ g_error ("Couldn't create native window needed for GstXOverlay!");
+
+#if defined (GDK_WINDOWING_WIN32)
+ window_handle = (guintptr) GDK_WINDOW_HWND (window);
+#elif defined (GDK_WINDOWING_QUARTZ)
+ window_handle = gdk_quartz_window_get_nsview (window);
+#elif defined (GDK_WINDOWING_X11)
+ window_handle = GDK_WINDOW_XID (window);
+#endif
+ g_object_set (play->renderer, "window-handle", (gpointer) window_handle,
+ NULL);
+}
+
+static void
+gtk_play_set_rate (GtkPlay * play, gdouble step)
+{
+ gdouble val;
+
+ val = gst_player_get_rate (play->player);
+ val += step;
+ if (val == 0.0)
+ val = step;
+ gst_player_set_rate (play->player, val);
+
+ if (val == 1.0)
+ gtk_label_set_label (play->rate_label, NULL);
+ else {
+ gchar *data;
+
+ data = g_strdup_printf ("%.2fx", val);
+ gtk_label_set_label (play->rate_label, data);
+ g_free (data);
+ }
+}
+
+static inline void
+seekbar_add_delta (GtkPlay * play, gint delta_sec)
+{
+ gdouble value = gtk_range_get_value (GTK_RANGE (play->seekbar));
+ gtk_range_set_value (GTK_RANGE (play->seekbar), value + delta_sec);
+}
+
+/* this mapping follow the mplayer key-bindings */
+static gboolean
+key_press_event_cb (GtkWidget * widget, GdkEventKey * event, gpointer data)
+{
+ GtkPlay *play = (GtkPlay *) widget;
+
+ if (event->state != 0 &&
+ ((event->state & GDK_CONTROL_MASK) || (event->state & GDK_MOD1_MASK) ||
+ (event->state & GDK_MOD3_MASK) || (event->state & GDK_MOD4_MASK)))
+ return FALSE;
+
+ if (event->type != GDK_KEY_PRESS)
+ return FALSE;
+
+ switch (event->keyval) {
+ case GDK_KEY_KP_Right:
+ case GDK_KEY_Right:{
+ /* seek forward 10 seconds */
+ seekbar_add_delta (play, 10);
+ break;
+ }
+ case GDK_KEY_KP_Left:
+ case GDK_KEY_Left:{
+ /* seek backward 10 seconds */
+ seekbar_add_delta (play, -10);
+ break;
+ }
+ case GDK_KEY_KP_Up:
+ case GDK_KEY_Up:{
+ /* seek forward 1 minute */
+ seekbar_add_delta (play, 60);
+ break;
+ }
+ case GDK_KEY_KP_Down:
+ case GDK_KEY_Down:{
+ /* seek backward 1 minute */
+ seekbar_add_delta (play, -60);
+ break;
+ }
+ case GDK_KEY_KP_Page_Up:
+ case GDK_KEY_Page_Up:{
+ /* Seek forward 10 minutes */
+ seekbar_add_delta (play, 600);
+ break;
+ }
+ case GDK_KEY_KP_Page_Down:
+ case GDK_KEY_Page_Down:{
+ /* Seek backward 10 minutes */
+ seekbar_add_delta (play, -600);
+ break;
+ }
+ case GDK_KEY_bracketleft:{
+ /* Decrease current playback speed by 10% */
+ gtk_play_set_rate (play, -0.1);
+ break;
+ }
+ case GDK_KEY_bracketright:{
+ /* Increase current playback speed by 10% */
+ gtk_play_set_rate (play, 0.1);
+ break;
+ break;
+ }
+ case GDK_KEY_braceleft:{
+ /* Decrease current playback speed by 10% */
+ gtk_play_set_rate (play, -1.0);
+ break;
+ }
+ case GDK_KEY_braceright:{
+ /* Increase current playback speed by 10% */
+ gtk_play_set_rate (play, 1.0);
+ break;
+ }
+ case GDK_KEY_BackSpace:{
+ /* Reset playback speed to normal */
+ gdouble val = gst_player_get_rate (play->player);
+ gtk_play_set_rate (play, 1.0 - val);
+ break;
+ }
+ case GDK_KEY_less:{
+ /* Go backward in the playlist */
+ if (g_list_previous (play->current_uri))
+ gtk_button_clicked (GTK_BUTTON (play->prev_button));
+ break;
+ }
+ case GDK_KEY_Return:
+ case GDK_KEY_greater:{
+ /* Go forward in the playlist */
+ if (g_list_next (play->current_uri))
+ gtk_button_clicked (GTK_BUTTON (play->next_button));
+ break;
+ }
+ case GDK_KEY_KP_9:
+ case GDK_KEY_9:{
+ /* Increase volume */
+ gdouble volume = gst_player_get_volume (play->player);
+ gtk_scale_button_set_value (GTK_SCALE_BUTTON (play->volume_button),
+ volume * 1.10);
+ break;
+ }
+ case GDK_KEY_KP_0:
+ case GDK_KEY_0:{
+ /* Decrease volume */
+ gdouble volume = gst_player_get_volume (play->player);
+ gtk_scale_button_set_value (GTK_SCALE_BUTTON (play->volume_button),
+ volume * 0.9);
+ break;
+ }
+ case GDK_KEY_m:{
+ /* Mute sound */
+ gboolean mute = gst_player_get_mute (play->player);
+ gst_player_set_mute (play->player, !mute);
+ break;
+ }
+ case GDK_KEY_f:{
+ /* Toggle fullscreen */
+ GtkToggleButton *fs = GTK_TOGGLE_BUTTON (play->fullscreen_button);
+ gboolean active = !gtk_toggle_button_get_active (fs);
+ gtk_toggle_button_set_active (fs, active);
+ break;
+ }
+ case GDK_KEY_p:
+ case GDK_KEY_space:
+ /* toggle pause/play */
+ gtk_button_clicked (GTK_BUTTON (play->play_pause_button));
+ break;
+ case GDK_KEY_q:
+ case GDK_KEY_Escape:
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
+G_MODULE_EXPORT void
+rewind_button_clicked_cb (GtkButton * button, GtkPlay * play)
+{
+ gtk_play_set_rate (play, -0.5);
+}
+
+G_MODULE_EXPORT void
+forward_button_clicked_cb (GtkButton * button, GtkPlay * play)
+{
+ gtk_play_set_rate (play, 0.5);
+}
+
+G_MODULE_EXPORT void
+play_pause_button_clicked_cb (GtkButton * button, GtkPlay * play)
+{
+ GtkWidget *image;
+
+ if (play->playing) {
+ gst_player_pause (play->player);
+ image = TOOLBAR_GET_OBJECT (play_image);
+ gtk_button_set_image (GTK_BUTTON (play->play_pause_button), image);
+ play->playing = FALSE;
+
+ if (play->inhibit_cookie)
+ gtk_application_uninhibit (GTK_APPLICATION (g_application_get_default ()),
+ play->inhibit_cookie);
+ play->inhibit_cookie = 0;
+ } else {
+ if (play->inhibit_cookie)
+ gtk_application_uninhibit (GTK_APPLICATION (g_application_get_default ()),
+ play->inhibit_cookie);
+ play->inhibit_cookie =
+ gtk_application_inhibit (GTK_APPLICATION (g_application_get_default ()),
+ GTK_WINDOW (play), GTK_APPLICATION_INHIBIT_IDLE, "Playing media");
+
+ gst_player_play (play->player);
+ image = TOOLBAR_GET_OBJECT (pause_image);
+ gtk_button_set_image (GTK_BUTTON (play->play_pause_button), image);
+ play->playing = TRUE;
+ }
+}
+
+static void
+play_current_uri (GtkPlay * play, GList * uri, const gchar * ext_suburi)
+{
+ /* reset the button/widget state to default */
+ g_signal_handlers_block_by_func (play->seekbar,
+ seekbar_value_changed_cb, play);
+ gtk_range_set_range (GTK_RANGE (play->seekbar), 0, 0);
+ g_signal_handlers_unblock_by_func (play->seekbar,
+ seekbar_value_changed_cb, play);
+ gtk_widget_set_sensitive (play->prev_button, g_list_previous (uri) != NULL);
+ gtk_widget_set_sensitive (play->next_button, g_list_next (uri) != NULL);
+ gtk_label_set_label (play->rate_label, NULL);
+
+ /* set uri or suburi */
+ if (ext_suburi)
+ gst_player_set_subtitle_uri (play->player, ext_suburi);
+ else
+ gst_player_set_uri (play->player, uri->data);
+ play->current_uri = uri;
+ if (play->playing) {
+ if (play->inhibit_cookie)
+ gtk_application_uninhibit (GTK_APPLICATION (g_application_get_default ()),
+ play->inhibit_cookie);
+ play->inhibit_cookie =
+ gtk_application_inhibit (GTK_APPLICATION (g_application_get_default ()),
+ GTK_WINDOW (play), GTK_APPLICATION_INHIBIT_IDLE, "Playing media");
+ gst_player_play (play->player);
+ } else {
+ gst_player_pause (play->player);
+ if (play->inhibit_cookie)
+ gtk_application_uninhibit (GTK_APPLICATION (g_application_get_default ()),
+ play->inhibit_cookie);
+ play->inhibit_cookie = 0;
+ }
+ set_title (play, uri->data);
+}
+
+G_MODULE_EXPORT void
+prev_button_clicked_cb (GtkButton * button, GtkPlay * play)
+{
+ GList *prev;
+
+ prev = g_list_previous (play->current_uri);
+ g_return_if_fail (prev != NULL);
+
+ play_current_uri (play, prev, NULL);
+}
+
+static gboolean
+color_balance_channel_change_value_cb (GtkRange * range, GtkScrollType scroll,
+ gdouble value, GtkPlay * play)
+{
+ GstPlayerColorBalanceType type;
+
+ type = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (range), "type"));
+
+ value = CLAMP (value, 0.0, 1.0);
+ gst_player_set_color_balance (play->player, type, value);
+
+ return FALSE;
+}
+
+static gboolean
+color_balance_channel_button_press_cb (GtkWidget * widget,
+ GdkEventButton * event, GtkPlay * play)
+{
+ GstPlayerColorBalanceType type;
+
+ if (event->type != GDK_2BUTTON_PRESS)
+ return FALSE;
+
+ type = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget), "type"));
+ gtk_range_set_value (GTK_RANGE (widget), 0.5);
+ gst_player_set_color_balance (play->player, type, 0.5);
+
+ return FALSE;
+}
+
+static void
+color_balance_dialog (GtkPlay * play)
+{
+ GtkWidget *dialog;
+ GtkWidget *content;
+ GtkWidget *box;
+ GtkWidget *ctlbox;
+ GtkWidget *label;
+ GtkWidget *scale;
+ gdouble value;
+ guint i;
+
+ dialog = gtk_dialog_new_with_buttons ("Color Balance", GTK_WINDOW (play),
+ GTK_DIALOG_DESTROY_WITH_PARENT, "_Close", GTK_RESPONSE_CLOSE, NULL);
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (play));
+
+ content = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
+ gtk_box_set_homogeneous (GTK_BOX (box), TRUE);
+ gtk_box_pack_start (GTK_BOX (content), box, TRUE, TRUE, 5);
+
+ for (i = GST_PLAYER_COLOR_BALANCE_BRIGHTNESS;
+ i <= GST_PLAYER_COLOR_BALANCE_HUE; i++) {
+ ctlbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ label = gtk_label_new (gst_player_color_balance_type_get_name (i));
+ scale = gtk_scale_new_with_range (GTK_ORIENTATION_VERTICAL, 0, 1, 0.5);
+ gtk_widget_set_size_request (scale, 0, 200);
+ gtk_box_pack_start (GTK_BOX (ctlbox), label, FALSE, TRUE, 2);
+ gtk_box_pack_end (GTK_BOX (ctlbox), scale, TRUE, TRUE, 2);
+
+ gtk_box_pack_end (GTK_BOX (box), ctlbox, TRUE, TRUE, 2);
+
+ value = gst_player_get_color_balance (play->player, i);
+ gtk_range_set_value (GTK_RANGE (scale), value);
+ g_object_set_data (G_OBJECT (scale), "type", GUINT_TO_POINTER (i));
+
+ g_signal_connect (scale, "change-value",
+ G_CALLBACK (color_balance_channel_change_value_cb), play);
+ g_signal_connect (scale, "button-press-event",
+ G_CALLBACK (color_balance_channel_button_press_cb), play);
+ }
+
+ gtk_widget_show_all (dialog);
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ gtk_widget_destroy (dialog);
+}
+
+static void
+color_balance_clicked_cb (GtkWidget * unused, GtkPlay * play)
+{
+ if (gst_player_has_color_balance (play->player)) {
+ color_balance_dialog (play);
+ return;
+ }
+
+ g_warning ("No color balance channels available.");
+ return;
+}
+
+static GList *
+open_file_dialog (GtkPlay * play, gboolean multi)
+{
+ int res;
+ GQueue uris = G_QUEUE_INIT;
+ GtkWidget *chooser;
+ GtkWidget *parent;
+
+ if (play) {
+ parent = GTK_WIDGET (play);
+ } else {
+ parent = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_application_add_window (GTK_APPLICATION (g_application_get_default ()),
+ GTK_WINDOW (parent));
+ }
+
+ chooser = gtk_file_chooser_dialog_new ("Select files to play", NULL,
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ "_Cancel", GTK_RESPONSE_CANCEL, "_Open", GTK_RESPONSE_ACCEPT, NULL);
+ g_object_set (chooser, "local-only", FALSE, "select-multiple", multi, NULL);
+ gtk_window_set_transient_for (GTK_WINDOW (chooser), GTK_WINDOW (parent));
+
+ res = gtk_dialog_run (GTK_DIALOG (chooser));
+ if (res == GTK_RESPONSE_ACCEPT) {
+ GSList *l;
+
+ l = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (chooser));
+ while (l) {
+ g_queue_push_tail (&uris, l->data);
+ l = g_slist_delete_link (l, l);
+ }
+ }
+
+ gtk_widget_destroy (chooser);
+ if (!play)
+ gtk_widget_destroy (parent);
+
+ return uris.head;
+}
+
+static void
+open_file_clicked_cb (GtkWidget * unused, GtkPlay * play)
+{
+ GList *uris;
+
+ uris = open_file_dialog (play, TRUE);
+ if (uris) {
+ /* free existing playlist */
+ g_list_free_full (play->uris, g_free);
+
+ play->uris = uris;
+ play_current_uri (play, g_list_first (play->uris), NULL);
+ }
+}
+
+G_MODULE_EXPORT void
+next_button_clicked_cb (GtkButton * button, GtkPlay * play)
+{
+ GList *next;
+
+ next = g_list_next (play->current_uri);
+ g_return_if_fail (next != NULL);
+
+ play_current_uri (play, next, NULL);
+}
+
+static const gchar *
+audio_channels_string (gint num)
+{
+ if (num == 1)
+ return "mono";
+ else if (num == 2)
+ return "stereo";
+ else if (num > 2)
+ return "surround";
+ else
+ return "unknown";
+}
+
+static gchar *
+stream_info_get_string (GstPlayerStreamInfo * stream, gint type, gboolean label)
+{
+ gchar *buffer = NULL;
+
+ switch (type) {
+ case AUDIO_INFO_RATE:
+ {
+ GstPlayerAudioInfo *audio = (GstPlayerAudioInfo *) stream;
+ buffer = g_strdup_printf ("%s%d", label ? "Sample rate : " : "",
+ gst_player_audio_info_get_sample_rate (audio));
+ break;
+ }
+ case AUDIO_INFO_LANGUAGE:
+ {
+ GstPlayerAudioInfo *audio = (GstPlayerAudioInfo *) stream;
+ const gchar *lang = gst_player_audio_info_get_language (audio);
+ if (lang)
+ buffer = g_strdup_printf ("%s%s", label ? "Language : " : "", lang);
+ break;
+ }
+ case AUDIO_INFO_CHANNELS:
+ {
+ GstPlayerAudioInfo *audio = (GstPlayerAudioInfo *) stream;
+ buffer = g_strdup_printf ("%s%s", label ? "Channels : " : "",
+ audio_channels_string (gst_player_audio_info_get_channels (audio)));
+ break;
+ }
+ case SUBTITLE_INFO_CODEC:
+ case VIDEO_INFO_CODEC:
+ case AUDIO_INFO_CODEC:
+ {
+ buffer = g_strdup_printf ("%s%s", label ? "Codec : " : "",
+ gst_player_stream_info_get_codec (stream));
+ break;
+ }
+ case AUDIO_INFO_MAX_BITRATE:
+ {
+ GstPlayerAudioInfo *audio = (GstPlayerAudioInfo *) stream;
+ gint bitrate = gst_player_audio_info_get_max_bitrate (audio);
+
+ if (bitrate > 0)
+ buffer = g_strdup_printf ("%s%d", label ? "Max bitrate : " : "",
+ bitrate);
+ break;
+ }
+ case VIDEO_INFO_MAX_BITRATE:
+ {
+ GstPlayerVideoInfo *video = (GstPlayerVideoInfo *) stream;
+ gint bitrate = gst_player_video_info_get_max_bitrate (video);
+
+ if (bitrate > 0)
+ buffer = g_strdup_printf ("%s%d", label ? "Max bitrate : " : "",
+ bitrate);
+ break;
+ }
+ case VIDEO_INFO_PAR:
+ {
+ guint par_d, par_n;
+ GstPlayerVideoInfo *video = (GstPlayerVideoInfo *) stream;
+
+ gst_player_video_info_get_pixel_aspect_ratio (video, &par_n, &par_d);
+ buffer = g_strdup_printf ("%s%u:%u", label ? "pixel-aspect-ratio : " :
+ "", par_n, par_d);
+ break;
+ }
+ case VIDEO_INFO_FPS:
+ {
+ gint fps_d, fps_n;
+ GstPlayerVideoInfo *video = (GstPlayerVideoInfo *) stream;
+
+ gst_player_video_info_get_framerate (video, &fps_n, &fps_d);
+ buffer = g_strdup_printf ("%s%.2f", label ? "Framerate : " : "",
+ (gdouble) fps_n / fps_d);
+ break;
+ }
+ case VIDEO_INFO_RESOLUTION:
+ {
+ GstPlayerVideoInfo *video = (GstPlayerVideoInfo *) stream;
+ buffer = g_strdup_printf ("%s%dx%d", label ? "Resolution : " : "",
+ gst_player_video_info_get_width (video),
+ gst_player_video_info_get_height (video));
+ break;
+ }
+ case SUBTITLE_INFO_LANGUAGE:
+ {
+ GstPlayerSubtitleInfo *sub = (GstPlayerSubtitleInfo *) stream;
+ buffer = g_strdup_printf ("%s%s", label ? "Language : " : "",
+ gst_player_subtitle_info_get_language (sub));
+ break;
+ }
+ default:
+ break;
+ }
+ return buffer;
+}
+
+static void
+fill_tree_model (GtkTreeStore * tree, GtkPlay * play, GstPlayerMediaInfo * info)
+{
+ GList *l;
+ guint count;
+ GtkTreeIter child, parent;
+
+ count = 0;
+ for (l = gst_player_media_info_get_stream_list (info); l != NULL; l = l->next) {
+ gchar *buffer;
+ gint i, start, end;
+ GstPlayerStreamInfo *stream = (GstPlayerStreamInfo *) l->data;
+
+ /* define the field range based on stream type */
+ if (GST_IS_PLAYER_VIDEO_INFO (stream)) {
+ start = VIDEO_INFO_START + 1;
+ end = VIDEO_INFO_END;
+ } else if (GST_IS_PLAYER_AUDIO_INFO (stream)) {
+ start = AUDIO_INFO_START + 1;
+ end = AUDIO_INFO_END;
+ } else {
+ start = SUBTITLE_INFO_START + 1;
+ end = SUBTITLE_INFO_END;
+ }
+
+ buffer = g_strdup_printf ("Stream %u", count++);
+ gtk_tree_store_append (tree, &parent, NULL);
+ gtk_tree_store_set (tree, &parent, COL_TEXT, buffer, -1);
+ g_free (buffer);
+
+ buffer = g_strdup_printf ("Type : %s",
+ gst_player_stream_info_get_stream_type (stream));
+ gtk_tree_store_append (tree, &child, &parent);
+ gtk_tree_store_set (tree, &child, COL_TEXT, buffer, -1);
+ g_free (buffer);
+
+ for (i = start; i < end; i++) {
+ buffer = stream_info_get_string (stream, i, TRUE);
+ if (buffer) {
+ gtk_tree_store_append (tree, &child, &parent);
+ gtk_tree_store_set (tree, &child, COL_TEXT, buffer, -1);
+ g_free (buffer);
+ }
+ }
+ }
+}
+
+G_MODULE_EXPORT void
+media_info_dialog_button_clicked_cb (GtkButton * button, GtkPlay * play)
+{
+ gtk_widget_destroy (GTK_WIDGET (play->media_info_dialog));
+ play->media_info_dialog = NULL;
+}
+
+static void
+media_info_dialog (GtkPlay * play, GstPlayerMediaInfo * media_info)
+{
+ GtkBuilder *dialog_ui;
+ GtkWidget *view;
+ GtkTreeStore *tree;
+ GtkTreeViewColumn *col;
+ GtkCellRenderer *renderer;
+
+ dialog_ui = load_from_builder ("/ui/media_info_dialog.ui", TRUE, play);
+ if (!dialog_ui)
+ return;
+
+ play->media_info_dialog =
+ (GtkWidget *) gtk_builder_get_object (dialog_ui, "media_info_dialog");
+ gtk_window_set_transient_for (GTK_WINDOW (play->media_info_dialog),
+ GTK_WINDOW (play));
+
+ view = (GtkWidget *) gtk_builder_get_object (dialog_ui, "view");
+ col = (GtkTreeViewColumn *) gtk_builder_get_object (dialog_ui, "col");
+
+ /* TODO: use glade cell renderer (not working for me) */
+ renderer = gtk_cell_renderer_text_new ();
+ gtk_tree_view_column_pack_start (col, renderer, TRUE);
+ gtk_tree_view_column_add_attribute (col, renderer, "text", COL_TEXT);
+
+ tree = (GtkTreeStore *) gtk_builder_get_object (dialog_ui, "tree");
+ fill_tree_model (tree, play, media_info);
+
+ g_signal_connect (view, "realize",
+ G_CALLBACK (gtk_tree_view_expand_all), NULL);
+
+ gtk_widget_set_size_request (play->media_info_dialog, 550, 450);
+
+ gtk_widget_show_all (play->media_info_dialog);
+ gtk_dialog_run (GTK_DIALOG (play->media_info_dialog));
+}
+
+static void
+media_info_clicked_cb (GtkButton * button, GtkPlay * play)
+{
+ GstPlayerMediaInfo *media_info;
+
+ media_info = gst_player_get_media_info (play->player);
+ if (!media_info)
+ return;
+
+ media_info_dialog (play, media_info);
+ g_object_unref (media_info);
+}
+
+static gboolean
+toolbar_hide_cb (GtkPlay * play)
+{
+ GdkCursor *cursor;
+
+ /* hide mouse pointer and toolbar */
+ gtk_widget_hide (play->toolbar);
+ cursor =
+ gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (play)),
+ GDK_BLANK_CURSOR);
+ gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (play->video_area)),
+ cursor);
+ g_object_unref (cursor);
+
+ play->toolbar_hide_timeout = 0;
+ return FALSE;
+}
+
+static void
+toolbar_show (GtkPlay * play)
+{
+ /* if timer is running then kill it */
+ if (play->toolbar_hide_timeout) {
+ g_source_remove (play->toolbar_hide_timeout);
+ play->toolbar_hide_timeout = 0;
+ }
+
+ /* show toolbar and mouse pointer */
+ gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET
+ (play->video_area)), play->default_cursor);
+ gtk_widget_show (play->toolbar);
+}
+
+static void
+start_toolbar_hide_timer (GtkPlay * play)
+{
+ /* hide toolbar only if its playing */
+ if (!play->playing)
+ return;
+
+ /* start timer to hide toolbar */
+ if (play->toolbar_hide_timeout)
+ g_source_remove (play->toolbar_hide_timeout);
+ play->toolbar_hide_timeout = g_timeout_add_seconds (5,
+ (GSourceFunc) toolbar_hide_cb, play);
+}
+
+G_MODULE_EXPORT void
+fullscreen_button_toggled_cb (GtkToggleButton * widget, GtkPlay * play)
+{
+ GtkWidget *image;
+
+ if (gtk_toggle_button_get_active (widget)) {
+ image = TOOLBAR_GET_OBJECT (restore_image);
+ gtk_window_fullscreen (GTK_WINDOW (play));
+ gtk_button_set_image (GTK_BUTTON (play->fullscreen_button), image);
+ } else {
+ image = TOOLBAR_GET_OBJECT (fullscreen_image);
+ gtk_window_unfullscreen (GTK_WINDOW (play));
+ gtk_button_set_image (GTK_BUTTON (play->fullscreen_button), image);
+ }
+}
+
+G_MODULE_EXPORT void
+seekbar_value_changed_cb (GtkRange * range, GtkPlay * play)
+{
+ gdouble value = gtk_range_get_value (GTK_RANGE (play->seekbar));
+ gst_player_seek (play->player, gst_util_uint64_scale (value, GST_SECOND, 1));
+}
+
+G_MODULE_EXPORT void
+volume_button_value_changed_cb (GtkScaleButton * button, gdouble value,
+ GtkPlay * play)
+{
+ gst_player_set_volume (play->player, value);
+}
+
+static gint
+_get_current_track_index (GtkPlay * play, void *(*func) (GstPlayer * player))
+{
+ void *obj;
+ gint index = -1;
+
+ obj = func (play->player);
+ if (obj) {
+ index = gst_player_stream_info_get_index ((GstPlayerStreamInfo *) obj);
+ g_object_unref (obj);
+ }
+
+ return index;
+}
+
+static gint
+get_current_track_index (GtkPlay * play, GType type)
+{
+ if (type == GST_TYPE_PLAYER_VIDEO_INFO)
+ return _get_current_track_index (play,
+ (void *) gst_player_get_current_video_track);
+ else if (type == GST_TYPE_PLAYER_AUDIO_INFO)
+ return _get_current_track_index (play,
+ (void *) gst_player_get_current_audio_track);
+ else
+ return _get_current_track_index (play,
+ (void *) gst_player_get_current_subtitle_track);
+}
+
+static gchar *
+get_menu_label (GstPlayerStreamInfo * stream, GType type)
+{
+ if (type == GST_TYPE_PLAYER_AUDIO_INFO) {
+ gchar *label = NULL;
+ gchar *lang, *codec, *channels;
+
+ /* label format: <codec_name> <channel> [language] */
+ lang = stream_info_get_string (stream, AUDIO_INFO_LANGUAGE, FALSE);
+ codec = stream_info_get_string (stream, AUDIO_INFO_CODEC, FALSE);
+ channels = stream_info_get_string (stream, AUDIO_INFO_CHANNELS, FALSE);
+
+ if (lang) {
+ label = g_strdup_printf ("%s %s [%s]", codec ? codec : "",
+ channels ? channels : "", lang);
+ g_free (lang);
+ } else
+ label = g_strdup_printf ("%s %s", codec ? codec : "",
+ channels ? channels : "");
+
+ g_free (codec);
+ g_free (channels);
+ return label;
+ } else if (type == GST_TYPE_PLAYER_VIDEO_INFO) {
+ /* label format: <codec_name> */
+ return stream_info_get_string (stream, VIDEO_INFO_CODEC, FALSE);
+ } else {
+ /* label format: <langauge> */
+ return stream_info_get_string (stream, SUBTITLE_INFO_LANGUAGE, FALSE);
+ }
+
+ return NULL;
+}
+
+static void
+new_subtitle_clicked_cb (GtkWidget * unused, GtkPlay * play)
+{
+ GList *uri;
+
+ uri = open_file_dialog (play, FALSE);
+ if (uri) {
+ play_current_uri (play, play->current_uri, uri->data);
+ g_list_free_full (uri, g_free);
+ }
+}
+
+static void
+disable_track (GtkPlay * play, GType type)
+{
+ if (type == GST_TYPE_PLAYER_VIDEO_INFO) {
+ gst_player_set_video_track_enabled (play->player, FALSE);
+ } else if (type == GST_TYPE_PLAYER_AUDIO_INFO)
+ gst_player_set_audio_track_enabled (play->player, FALSE);
+ else
+ gst_player_set_subtitle_track_enabled (play->player, FALSE);
+}
+
+static void
+change_track (GtkPlay * play, gint index, GType type)
+{
+ if (type == GST_TYPE_PLAYER_VIDEO_INFO) {
+ gst_player_set_video_track (play->player, index);
+ gst_player_set_video_track_enabled (play->player, TRUE);
+ } else if (type == GST_TYPE_PLAYER_AUDIO_INFO) {
+ gst_player_set_audio_track (play->player, index);
+ gst_player_set_audio_track_enabled (play->player, TRUE);
+ } else {
+ gst_player_set_subtitle_track (play->player, index);
+ gst_player_set_subtitle_track_enabled (play->player, TRUE);
+ }
+}
+
+static void
+track_changed_cb (GtkWidget * widget, GtkPlay * play)
+{
+ GType type;
+ gint index;
+
+ /* check if button is toggled */
+ if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget)))
+ return;
+
+ index = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "index"));
+ type = GPOINTER_TO_SIZE (g_object_get_data (G_OBJECT (widget), "type"));
+
+ if (index == -1)
+ disable_track (play, type);
+ else
+ change_track (play, index, type);
+}
+
+static void
+visualization_changed_cb (GtkWidget * widget, GtkPlay * play)
+{
+ gchar *name;
+
+ if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget))) {
+ name = g_object_get_data (G_OBJECT (widget), "name");
+ if (g_strcmp0 (name, "disable") == 0) {
+ gst_player_set_visualization_enabled (play->player, FALSE);
+ } else {
+ const gchar *vis_name;
+
+ gst_player_set_visualization (play->player, name);
+ /* if visualization is not enabled then enable it */
+ if (!(vis_name = gst_player_get_current_visualization (play->player))) {
+ gst_player_set_visualization_enabled (play->player, TRUE);
+ }
+ }
+ }
+}
+
+static GtkWidget *
+create_visualization_menu (GtkPlay * play)
+{
+ GtkWidget *menu;
+ GtkWidget *item;
+ GtkWidget *sep;
+ GSList *group = NULL;
+ const gchar *cur_vis;
+ GstPlayerVisualization **viss, **p;
+
+ menu = gtk_menu_new ();
+ cur_vis = gst_player_get_current_visualization (play->player);
+ viss = gst_player_visualizations_get ();
+
+ p = viss;
+ while (*p) {
+ gchar *label = g_strdup ((*p)->name);
+
+ item = gtk_radio_menu_item_new_with_label (group, label);
+ group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
+ if (g_strcmp0 (label, cur_vis) == 0)
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
+ g_object_set_data_full (G_OBJECT (item), "name", label,
+ (GDestroyNotify) g_free);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ g_signal_connect (G_OBJECT (item), "toggled",
+ G_CALLBACK (visualization_changed_cb), play);
+ p++;
+ }
+ gst_player_visualizations_free (viss);
+
+ sep = gtk_separator_menu_item_new ();
+ item = gtk_radio_menu_item_new_with_label (group, "Disable");
+ group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
+ g_object_set_data (G_OBJECT (item), "name", (gpointer) "disable");
+ if (cur_vis == NULL)
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
+ g_signal_connect (G_OBJECT (item), "toggled",
+ G_CALLBACK (visualization_changed_cb), play);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), sep);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+
+ return menu;
+}
+
+static GtkWidget *
+create_tracks_menu (GtkPlay * play, GstPlayerMediaInfo * media_info, GType type)
+{
+ GtkWidget *menu;
+ GtkWidget *item;
+ GtkWidget *sep;
+ GList *list, *l;
+ gint current_index;
+ GSList *group = NULL;
+
+ if (!media_info)
+ return NULL;
+
+ current_index = get_current_track_index (play, type);
+
+ if (type == GST_TYPE_PLAYER_VIDEO_INFO)
+ list = gst_player_get_video_streams (media_info);
+ else if (type == GST_TYPE_PLAYER_AUDIO_INFO)
+ list = gst_player_get_audio_streams (media_info);
+ else
+ list = gst_player_get_subtitle_streams (media_info);
+
+ menu = gtk_menu_new ();
+
+ if (type == GST_TYPE_PLAYER_SUBTITLE_INFO) {
+ GtkWidget *ext_subtitle;
+ ext_subtitle = gtk_menu_item_new_with_label ("New File");
+ sep = gtk_separator_menu_item_new ();
+ g_signal_connect (G_OBJECT (ext_subtitle), "activate",
+ G_CALLBACK (new_subtitle_clicked_cb), play);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), ext_subtitle);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), sep);
+ }
+
+ for (l = list; l != NULL; l = l->next) {
+ gint index;
+ gchar *buffer;
+ GstPlayerStreamInfo *s = (GstPlayerStreamInfo *) l->data;
+
+ buffer = get_menu_label (s, type);
+ item = gtk_radio_menu_item_new_with_label (group, buffer);
+ group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
+ index = gst_player_stream_info_get_index (s);
+ g_object_set_data (G_OBJECT (item), "index", GINT_TO_POINTER (index));
+ g_object_set_data (G_OBJECT (item), "type", GSIZE_TO_POINTER (type));
+ if (current_index == index)
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
+ g_free (buffer);
+ g_signal_connect (G_OBJECT (item), "toggled",
+ G_CALLBACK (track_changed_cb), play);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ }
+
+ sep = gtk_separator_menu_item_new ();
+ item = gtk_radio_menu_item_new_with_label (group, "Disable");
+ group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
+ g_object_set_data (G_OBJECT (item), "index", GINT_TO_POINTER (-1));
+ g_object_set_data (G_OBJECT (item), "type", GSIZE_TO_POINTER (type));
+ if (current_index == -1)
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
+ g_signal_connect (G_OBJECT (item), "toggled",
+ G_CALLBACK (track_changed_cb), play);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), sep);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+
+ return menu;
+}
+
+static void
+player_quit_clicked_cb (GtkButton * button, GtkPlay * play)
+{
+ gtk_widget_destroy (GTK_WIDGET (play));
+}
+
+static void
+gtk_player_popup_menu_create (GtkPlay * play, GdkEventButton * event)
+{
+ GtkWidget *menu;
+ GtkWidget *info;
+ GtkWidget *audio;
+ GtkWidget *video;
+ GtkWidget *sub;
+ GtkWidget *quit;
+ GtkWidget *next;
+ GtkWidget *prev;
+ GtkWidget *open;
+ GtkWidget *submenu;
+ GtkWidget *vis;
+ GtkWidget *cb;
+ GstPlayerMediaInfo *media_info;
+
+ menu = gtk_menu_new ();
+ info = gtk_menu_item_new_with_label ("Media Information");
+ audio = gtk_menu_item_new_with_label ("Audio");
+ video = gtk_menu_item_new_with_label ("Video");
+ sub = gtk_menu_item_new_with_label ("Subtitle");
+ open = gtk_menu_item_new_with_label ("Open");
+ next = gtk_menu_item_new_with_label ("Next");
+ prev = gtk_menu_item_new_with_label ("Prev");
+ quit = gtk_menu_item_new_with_label ("Quit");
+ vis = gtk_menu_item_new_with_label ("Visualization");
+ cb = gtk_menu_item_new_with_label ("Color Balance");
+
+ media_info = gst_player_get_media_info (play->player);
+
+ if (media_info && !gst_player_get_video_streams (media_info))
+ gtk_widget_set_sensitive (video, FALSE);
+ else {
+ submenu = create_tracks_menu (play, media_info, GST_TYPE_PLAYER_VIDEO_INFO);
+ if (submenu)
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (video), submenu);
+ else
+ gtk_widget_set_sensitive (video, FALSE);
+ }
+
+ if (media_info && !gst_player_get_audio_streams (media_info))
+ gtk_widget_set_sensitive (audio, FALSE);
+ else {
+ submenu = create_tracks_menu (play, media_info, GST_TYPE_PLAYER_AUDIO_INFO);
+ if (submenu)
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (audio), submenu);
+ else
+ gtk_widget_set_sensitive (audio, FALSE);
+ }
+
+ /* enable visualization menu for audio stream */
+ if (media_info &&
+ gst_player_get_audio_streams (media_info) &&
+ !gst_player_get_video_streams (media_info)) {
+ submenu = create_visualization_menu (play);
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (vis), submenu);
+ } else {
+ gtk_widget_set_sensitive (vis, FALSE);
+ }
+
+ if (media_info && gst_player_get_video_streams (media_info)) {
+ submenu = create_tracks_menu (play, media_info,
+ GST_TYPE_PLAYER_SUBTITLE_INFO);
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (sub), submenu);
+ } else {
+ gtk_widget_set_sensitive (sub, FALSE);
+ }
+
+ gtk_widget_set_sensitive (next, g_list_next
+ (play->current_uri) ? TRUE : FALSE);
+ gtk_widget_set_sensitive (prev, g_list_previous
+ (play->current_uri) ? TRUE : FALSE);
+ gtk_widget_set_sensitive (info, media_info ? TRUE : FALSE);
+ gtk_widget_set_sensitive (cb, gst_player_has_color_balance (play->player) ?
+ TRUE : FALSE);
+
+ g_signal_connect (G_OBJECT (open), "activate",
+ G_CALLBACK (open_file_clicked_cb), play);
+ g_signal_connect (G_OBJECT (cb), "activate",
+ G_CALLBACK (color_balance_clicked_cb), play);
+ g_signal_connect (G_OBJECT (next), "activate",
+ G_CALLBACK (next_button_clicked_cb), play);
+ g_signal_connect (G_OBJECT (prev), "activate",
+ G_CALLBACK (prev_button_clicked_cb), play);
+ g_signal_connect (G_OBJECT (info), "activate",
+ G_CALLBACK (media_info_clicked_cb), play);
+ g_signal_connect (G_OBJECT (quit), "activate",
+ G_CALLBACK (player_quit_clicked_cb), play);
+
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), open);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), next);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), prev);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), video);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), audio);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), vis);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), sub);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), info);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), cb);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), quit);
+
+ gtk_widget_show_all (menu);
+ gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
+ (event != NULL) ? event->button : 0,
+ gdk_event_get_time ((GdkEvent *) event));
+
+ if (media_info)
+ g_object_unref (media_info);
+}
+
+static void
+mouse_button_pressed_cb (GtkWidget * unused, GdkEventButton * event,
+ GtkPlay * play)
+{
+ if (event->type == GDK_2BUTTON_PRESS) {
+ /* toggle fullscreen on double button click */
+ if (gtk_toggle_button_get_active
+ (GTK_TOGGLE_BUTTON (play->fullscreen_button)))
+ gtk_toggle_button_set_active
+ (GTK_TOGGLE_BUTTON (play->fullscreen_button), FALSE);
+ else
+ gtk_toggle_button_set_active
+ (GTK_TOGGLE_BUTTON (play->fullscreen_button), TRUE);
+ } else if ((event->type == GDK_BUTTON_PRESS) && (event->button == 3)) {
+ /* popup menu on right button click */
+ gtk_player_popup_menu_create (play, event);
+ }
+}
+
+static gboolean
+video_area_leave_notify_cb (GtkWidget * widget, GdkEvent * event,
+ GtkPlay * play)
+{
+ start_toolbar_hide_timer (play);
+
+ return TRUE;
+}
+
+static gboolean
+video_area_toolbar_show_cb (GtkWidget * widget, GdkEvent * event,
+ GtkPlay * play)
+{
+ toolbar_show (play);
+
+ start_toolbar_hide_timer (play);
+
+ return TRUE;
+}
+
+static gboolean
+overlay_leave_notify_event_cb (GtkWidget * widget, GdkEvent * event,
+ GtkPlay * play)
+{
+ start_toolbar_hide_timer (play);
+
+ return TRUE;
+}
+
+static gboolean
+overlay_enter_notify_event_cb (GtkWidget * widget, GdkEvent * event,
+ GtkPlay * play)
+{
+ toolbar_show (play);
+
+ return TRUE;
+}
+
+static void
+apply_css (GtkWidget * widget, GtkStyleProvider * provider)
+{
+ gtk_style_context_add_provider (gtk_widget_get_style_context (widget),
+ provider, G_MAXUINT);
+ if (GTK_IS_CONTAINER (widget)) {
+ gtk_container_forall (GTK_CONTAINER (widget),
+ (GtkCallback) apply_css, provider);
+ }
+}
+
+static void
+gtk_widget_apply_css (GtkWidget * widget, const gchar * filename)
+{
+ GBytes *bytes;
+ gsize data_size;
+ const guint8 *data;
+ GError *err = NULL;
+ GtkStyleProvider *provider;
+
+ if (widget == NULL)
+ return;
+
+ provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
+ bytes = g_resources_lookup_data (filename, 0, &err);
+ if (err) {
+ g_print ("ERROR: failed to apply css %s '%s' \n", filename, err->message);
+ return;
+ }
+ data = g_bytes_get_data (bytes, &data_size);
+ gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider),
+ (gchar *) data, data_size, NULL);
+ g_bytes_unref (bytes);
+
+ apply_css (widget, provider);
+}
+
+static gboolean
+get_child_position (GtkOverlay * overlay, GtkWidget * widget,
+ GtkAllocation * alloc, GtkPlay * play)
+{
+ GtkRequisition req;
+ GtkWidget *child;
+ GtkAllocation main_alloc;
+ gint x, y;
+ GtkWidget *relative = play->video_area;
+
+ child = gtk_bin_get_child (GTK_BIN (overlay));
+ gtk_widget_translate_coordinates (relative, child, 0, 0, &x, &y);
+ main_alloc.x = x;
+ main_alloc.y = y;
+ main_alloc.width = gtk_widget_get_allocated_width (relative);
+ main_alloc.height = gtk_widget_get_allocated_height (relative);
+
+ gtk_widget_get_preferred_size (widget, NULL, &req);
+
+ alloc->x = (main_alloc.width - req.width) / 2;
+ if (alloc->x < 0)
+ alloc->x = 0;
+ alloc->width = MIN (main_alloc.width, req.width);
+ if (gtk_widget_get_halign (widget) == GTK_ALIGN_END)
+ alloc->x += main_alloc.width - req.width;
+
+ alloc->y = main_alloc.height - req.height - 20;
+ if (alloc->y < 0)
+ alloc->y = 0;
+ alloc->height = MIN (main_alloc.height, req.height);
+ if (gtk_widget_get_valign (widget) == GTK_ALIGN_END)
+ alloc->y += main_alloc.height - req.height;
+
+ return TRUE;
+}
+
+static void
+create_ui (GtkPlay * play)
+{
+ GtkWidget *main_hbox;
+
+ gtk_window_set_default_size (GTK_WINDOW (play), 640, 480);
+
+ g_signal_connect (G_OBJECT (play), "delete-event",
+ G_CALLBACK (delete_event_cb), play);
+
+ gtk_widget_set_events (GTK_WIDGET (play),
+ GDK_KEY_RELEASE_MASK | GDK_KEY_PRESS_MASK);
+ g_signal_connect (G_OBJECT (play), "key-press-event",
+ G_CALLBACK (key_press_event_cb), NULL);
+
+ set_title (play, APP_NAME);
+ gtk_application_add_window (GTK_APPLICATION (g_application_get_default ()),
+ GTK_WINDOW (play));
+
+ play->renderer = gst_player_gtk_video_renderer_new ();
+ if (play->renderer) {
+ play->video_area =
+ gst_player_gtk_video_renderer_get_widget (GST_PLAYER_GTK_VIDEO_RENDERER
+ (play->renderer));
+ } else {
+ play->renderer = gst_player_video_overlay_video_renderer_new (NULL);
+
+ play->video_area = gtk_drawing_area_new ();
+ g_signal_connect (play->video_area, "realize",
+ G_CALLBACK (video_area_realize_cb), play);
+ }
+ gtk_widget_set_events (play->video_area, GDK_EXPOSURE_MASK
+ | GDK_LEAVE_NOTIFY_MASK
+ | GDK_BUTTON_PRESS_MASK
+ | GDK_POINTER_MOTION_MASK
+ | GDK_POINTER_MOTION_HINT_MASK | GDK_ENTER_NOTIFY_MASK);
+ g_signal_connect (play->video_area, "motion-notify-event",
+ G_CALLBACK (video_area_toolbar_show_cb), play);
+ g_signal_connect (play->video_area, "scroll-event",
+ G_CALLBACK (video_area_toolbar_show_cb), play);
+ g_signal_connect (play->video_area, "button-press-event",
+ G_CALLBACK (mouse_button_pressed_cb), play);
+ g_signal_connect (play->video_area, "leave-notify-event",
+ G_CALLBACK (video_area_leave_notify_cb), play);
+
+ /* load toolbar UI */
+ play->toolbar_ui = load_from_builder ("/ui/toolbar.ui", TRUE, play);
+ if (!play->toolbar_ui)
+ return;
+
+ play->toolbar = TOOLBAR_GET_OBJECT (toolbar);
+ play->play_pause_button = TOOLBAR_GET_OBJECT (play_pause_button);
+ play->seekbar = TOOLBAR_GET_OBJECT (seekbar);
+ play->next_button = TOOLBAR_GET_OBJECT (next_button);
+ play->prev_button = TOOLBAR_GET_OBJECT (prev_button);
+ play->fullscreen_button = TOOLBAR_GET_OBJECT (fullscreen_button);
+ play->volume_button = TOOLBAR_GET_OBJECT (volume_button);
+ play->elapshed_label = TOOLBAR_GET_LABEL (elapshed_time);
+ play->remain_label = TOOLBAR_GET_LABEL (remain_time);
+ play->rate_label = TOOLBAR_GET_LABEL (rate_label);
+ play->title_label = TOOLBAR_GET_LABEL (title_label);
+
+ main_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_box_pack_start (GTK_BOX (main_hbox), play->video_area, TRUE, TRUE, 0);
+
+ /* set minimum window size */
+ gtk_widget_set_size_request (main_hbox, 320, 240);
+
+ /* set the toolbar size */
+ gtk_widget_set_size_request (play->toolbar, 500, 50);
+
+ play->toolbar_overlay = gtk_overlay_new ();
+ gtk_overlay_add_overlay (GTK_OVERLAY (play->toolbar_overlay), play->toolbar);
+ gtk_container_add (GTK_CONTAINER (play->toolbar_overlay), main_hbox);
+ gtk_container_add (GTK_CONTAINER (play), play->toolbar_overlay);
+ gtk_widget_set_events (play->toolbar_overlay, GDK_EXPOSURE_MASK
+ | GDK_LEAVE_NOTIFY_MASK
+ | GDK_BUTTON_PRESS_MASK
+ | GDK_POINTER_MOTION_MASK
+ | GDK_POINTER_MOTION_HINT_MASK | GDK_ENTER_NOTIFY_MASK);
+
+ g_signal_connect (play->toolbar_overlay, "get-child-position",
+ G_CALLBACK (get_child_position), play);
+ g_signal_connect (play->toolbar_overlay, "leave-notify-event",
+ G_CALLBACK (overlay_leave_notify_event_cb), play);
+ g_signal_connect (play->toolbar_overlay, "enter-notify-event",
+ G_CALLBACK (overlay_enter_notify_event_cb), play);
+
+ /* apply css on widgets */
+ gtk_widget_apply_css (play->toolbar, "/css/toolbar.css");
+
+ gtk_widget_realize (play->video_area);
+ gtk_widget_hide (play->video_area);
+
+ /* start toolbar autohide timer */
+ start_toolbar_hide_timer (play);
+
+ /* check if we need to enable fullscreen */
+ if (play->fullscreen)
+ gtk_toggle_button_set_active
+ (GTK_TOGGLE_BUTTON (play->fullscreen_button), TRUE);
+}
+
+static void
+duration_changed_cb (GstPlayer * unused, GstClockTime duration, GtkPlay * play)
+{
+ g_signal_handlers_block_by_func (play->seekbar,
+ seekbar_value_changed_cb, play);
+ gtk_range_set_range (GTK_RANGE (play->seekbar), 0.0,
+ (gdouble) duration / GST_SECOND);
+ g_signal_handlers_unblock_by_func (play->seekbar,
+ seekbar_value_changed_cb, play);
+}
+
+static void
+update_position_label (GtkLabel * label, guint64 seconds)
+{
+ gchar *data;
+ gint hrs, mins;
+
+ hrs = seconds / 3600;
+ seconds -= hrs * 3600;
+ mins = seconds / 60;
+ seconds -= mins * 60;
+
+ if (hrs)
+ data = g_strdup_printf ("%d:%02d:%02" G_GUINT64_FORMAT, hrs, mins, seconds);
+ else
+ data = g_strdup_printf ("%02d:%02" G_GUINT64_FORMAT, mins, seconds);
+
+ gtk_label_set_label (label, data);
+ g_free (data);
+}
+
+static void
+position_updated_cb (GstPlayer * unused, GstClockTime position, GtkPlay * play)
+{
+ g_signal_handlers_block_by_func (play->seekbar,
+ seekbar_value_changed_cb, play);
+ gtk_range_set_value (GTK_RANGE (play->seekbar),
+ (gdouble) position / GST_SECOND);
+ update_position_label (play->elapshed_label, position / GST_SECOND);
+ update_position_label (play->remain_label,
+ GST_CLOCK_DIFF (position, gst_player_get_duration (play->player)) /
+ GST_SECOND);
+ g_signal_handlers_unblock_by_func (play->seekbar,
+ seekbar_value_changed_cb, play);
+}
+
+static void
+eos_cb (GstPlayer * unused, GtkPlay * play)
+{
+ if (play->playing) {
+ GList *next = NULL;
+
+ next = g_list_next (play->current_uri);
+ if (!next && play->loop)
+ next = g_list_first (play->uris);
+
+ if (next) {
+ play_current_uri (play, next, NULL);
+ } else {
+ GtkWidget *image;
+
+ gst_player_pause (play->player);
+ image = TOOLBAR_GET_OBJECT (play_image);
+ gtk_button_set_image (GTK_BUTTON (play->play_pause_button), image);
+ play->playing = FALSE;
+ if (play->inhibit_cookie)
+ gtk_application_uninhibit (GTK_APPLICATION (g_application_get_default
+ ()), play->inhibit_cookie);
+ play->inhibit_cookie = 0;
+ }
+ }
+}
+
+static GdkPixbuf *
+gtk_play_get_cover_image (GstPlayerMediaInfo * media_info)
+{
+ GstSample *sample;
+ GstMapInfo info;
+ GstBuffer *buffer;
+ GError *err = NULL;
+ GdkPixbufLoader *loader;
+ GdkPixbuf *pixbuf = NULL;
+ const GstStructure *caps_struct;
+ GstTagImageType type = GST_TAG_IMAGE_TYPE_UNDEFINED;
+
+ /* get image sample buffer from media */
+ sample = gst_player_media_info_get_image_sample (media_info);
+ if (!sample)
+ return NULL;
+
+ buffer = gst_sample_get_buffer (sample);
+ caps_struct = gst_sample_get_info (sample);
+
+ /* if sample is retrieved from preview-image tag then caps struct
+ * will not be defined. */
+ if (caps_struct)
+ gst_structure_get_enum (caps_struct, "image-type",
+ GST_TYPE_TAG_IMAGE_TYPE, &type);
+
+ /* FIXME: Should we check more type ?? */
+ if ((type != GST_TAG_IMAGE_TYPE_FRONT_COVER) &&
+ (type != GST_TAG_IMAGE_TYPE_UNDEFINED) &&
+ (type != GST_TAG_IMAGE_TYPE_NONE)) {
+ g_print ("unsupport type ... %d \n", type);
+ return NULL;
+ }
+
+ if (!gst_buffer_map (buffer, &info, GST_MAP_READ)) {
+ g_print ("failed to map gst buffer \n");
+ return NULL;
+ }
+
+ loader = gdk_pixbuf_loader_new ();
+ if (gdk_pixbuf_loader_write (loader, info.data, info.size, &err) &&
+ gdk_pixbuf_loader_close (loader, &err)) {
+ pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
+ if (pixbuf) {
+ g_object_ref (pixbuf);
+ } else {
+ g_print ("failed to convert gst buffer to pixbuf %s \n", err->message);
+ g_error_free (err);
+ }
+ }
+
+ g_object_unref (loader);
+ gst_buffer_unmap (buffer, &info);
+
+ return pixbuf;
+}
+
+static void
+media_info_updated_cb (GstPlayer * player, GstPlayerMediaInfo * media_info,
+ GtkPlay * play)
+{
+ const gchar *title;
+ GdkPixbuf *pixbuf;
+ gchar *basename = NULL;
+ gchar *filename = NULL;
+
+ title = gst_player_media_info_get_title (media_info);
+
+ if (!title) {
+ filename =
+ g_filename_from_uri (gst_player_media_info_get_uri (media_info), NULL,
+ NULL);
+ basename = g_path_get_basename (filename);
+ }
+
+ gtk_label_set_label (play->title_label, title ? title : basename);
+ set_title (play, title ? title : filename);
+ g_free (basename);
+ g_free (filename);
+
+ pixbuf = gtk_play_get_cover_image (media_info);
+
+ if (pixbuf) {
+ gtk_window_set_icon (GTK_WINDOW (play), pixbuf);
+ g_object_unref (pixbuf);
+ }
+}
+
+static void
+player_volume_changed_cb (GstPlayer * player, GtkPlay * play)
+{
+ gdouble new_val, cur_val;
+
+ cur_val = gtk_scale_button_get_value (GTK_SCALE_BUTTON (play->volume_button));
+ new_val = gst_player_get_volume (play->player);
+
+ if (fabs (cur_val - new_val) > 0.001) {
+ g_signal_handlers_block_by_func (play->volume_button,
+ volume_button_value_changed_cb, play);
+ gtk_scale_button_set_value (GTK_SCALE_BUTTON (play->volume_button),
+ new_val);
+ g_signal_handlers_unblock_by_func (play->volume_button,
+ volume_button_value_changed_cb, play);
+ }
+}
+
+static void
+gtk_play_set_property (GObject * object, guint prop_id, const GValue * value,
+ GParamSpec * pspec)
+{
+ GtkPlay *self = (GtkPlay *) object;
+
+ switch (prop_id) {
+ case PROP_LOOP:
+ self->loop = g_value_get_boolean (value);
+ break;
+ case PROP_FULLSCREEN:
+ self->fullscreen = g_value_get_boolean (value);
+ break;
+ case PROP_URIS:
+ self->uris = g_value_get_pointer (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+show_cb (GtkWidget * widget, gpointer user_data)
+{
+ GtkPlay *self = (GtkPlay *) widget;
+
+ self->default_cursor = gdk_window_get_cursor
+ (gtk_widget_get_window (GTK_WIDGET (self)));
+
+ play_current_uri (self, g_list_first (self->uris), NULL);
+}
+
+static GObject *
+gtk_play_constructor (GType type, guint n_construct_params,
+ GObjectConstructParam * construct_params)
+{
+ GtkPlay *self;
+
+ self =
+ (GtkPlay *) G_OBJECT_CLASS (gtk_play_parent_class)->constructor (type,
+ n_construct_params, construct_params);
+
+ self->playing = TRUE;
+
+ if (self->inhibit_cookie)
+ gtk_application_uninhibit (GTK_APPLICATION (g_application_get_default ()),
+ self->inhibit_cookie);
+ self->inhibit_cookie =
+ gtk_application_inhibit (GTK_APPLICATION (g_application_get_default ()),
+ GTK_WINDOW (self), GTK_APPLICATION_INHIBIT_IDLE, "Playing media");
+
+ create_ui (self);
+
+ self->player =
+ gst_player_new (self->renderer,
+ gst_player_g_main_context_signal_dispatcher_new (NULL));
+
+ g_signal_connect (self->player, "position-updated",
+ G_CALLBACK (position_updated_cb), self);
+ g_signal_connect (self->player, "duration-changed",
+ G_CALLBACK (duration_changed_cb), self);
+ g_signal_connect (self->player, "end-of-stream", G_CALLBACK (eos_cb), self);
+ g_signal_connect (self->player, "media-info-updated",
+ G_CALLBACK (media_info_updated_cb), self);
+ g_signal_connect (self->player, "volume-changed",
+ G_CALLBACK (player_volume_changed_cb), self);
+
+ /* enable visualization (by default playbin uses goom) */
+ /* if visualization is enabled then use the first element */
+ gst_player_set_visualization_enabled (self->player, TRUE);
+
+ g_signal_connect (G_OBJECT (self), "show", G_CALLBACK (show_cb), NULL);
+
+ return G_OBJECT (self);
+}
+
+static void
+gtk_play_dispose (GObject * object)
+{
+ GtkPlay *self = (GtkPlay *) object;
+
+ if (self->inhibit_cookie)
+ gtk_application_uninhibit (GTK_APPLICATION (g_application_get_default ()),
+ self->inhibit_cookie);
+ self->inhibit_cookie = 0;
+
+ if (self->uris)
+ g_list_free_full (self->uris, g_free);
+ self->uris = NULL;
+ if (self->player) {
+ gst_player_stop (self->player);
+ g_object_unref (self->player);
+ }
+ self->player = NULL;
+ g_clear_object (&self->video_area);
+
+ G_OBJECT_CLASS (gtk_play_parent_class)->dispose (object);
+}
+
+static void
+gtk_play_init (GtkPlay * self)
+{
+}
+
+static void
+gtk_play_class_init (GtkPlayClass * klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->constructor = gtk_play_constructor;
+ object_class->dispose = gtk_play_dispose;
+ object_class->set_property = gtk_play_set_property;
+
+ gtk_play_properties[PROP_LOOP] =
+ g_param_spec_boolean ("loop", "Loop", "Loop the playlist",
+ FALSE,
+ G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+ gtk_play_properties[PROP_FULLSCREEN] =
+ g_param_spec_boolean ("fullscreen", "Fullscreen", "Fullscreen mode",
+ FALSE,
+ G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+ gtk_play_properties[PROP_URIS] =
+ g_param_spec_pointer ("uris", "URIs", "URIs to play",
+ G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+
+ g_object_class_install_properties (object_class, LAST_PROP,
+ gtk_play_properties);
+}
+
+static gint
+gtk_play_app_command_line (GApplication * application,
+ GApplicationCommandLine * command_line)
+{
+ GVariantDict *options;
+ GtkPlay *play;
+ GList *uris = NULL;
+ gboolean loop = FALSE, fullscreen = FALSE;
+ gchar **uris_array = NULL;
+
+ options = g_application_command_line_get_options_dict (command_line);
+
+ g_variant_dict_lookup (options, "loop", "b", &loop);
+ g_variant_dict_lookup (options, "fullscreen", "b", &fullscreen);
+ g_variant_dict_lookup (options, G_OPTION_REMAINING, "^a&ay", &uris_array);
+
+ if (uris_array) {
+ gchar **p;
+ GQueue uris_builder = G_QUEUE_INIT;
+
+ p = uris_array;
+ while (*p) {
+ g_queue_push_tail (&uris_builder, gst_uri_is_valid (*p) ?
+ g_strdup (*p) : gst_filename_to_uri (*p, NULL));
+ p++;
+ }
+ uris = uris_builder.head;
+ } else {
+ uris = open_file_dialog (NULL, TRUE);
+ }
+
+ if (!uris)
+ return -1;
+
+ play =
+ g_object_new (gtk_play_get_type (), "loop", loop, "fullscreen",
+ fullscreen, "uris", uris, NULL);
+ gtk_widget_show_all (GTK_WIDGET (play));
+
+ return
+ G_APPLICATION_CLASS (gtk_play_app_parent_class)->command_line
+ (application, command_line);
+}
+
+static void
+gtk_play_app_init (GtkPlayApp * self)
+{
+}
+
+static void
+gtk_play_app_class_init (GtkPlayAppClass * klass)
+{
+ GApplicationClass *application_class = G_APPLICATION_CLASS (klass);
+
+ application_class->command_line = gtk_play_app_command_line;
+}
+
+static GtkPlayApp *
+gtk_play_app_new (void)
+{
+ GtkPlayApp *self;
+ GOptionEntry options[] = {
+ {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, NULL,
+ "Files to play"},
+ {"loop", 'l', 0, G_OPTION_ARG_NONE, NULL, "Repeat all"},
+ {"fullscreen", 'f', 0, G_OPTION_ARG_NONE, NULL,
+ "Show the player in fullscreen"},
+ {NULL}
+ };
+
+ g_set_prgname (APP_NAME);
+ g_set_application_name (APP_NAME);
+
+ self = g_object_new (gtk_play_app_get_type (),
+ "application-id", "org.freedesktop.gstreamer.GTKPlay",
+ "flags", G_APPLICATION_HANDLES_COMMAND_LINE,
+ "register-session", TRUE, NULL);
+
+ g_application_set_default (G_APPLICATION (self));
+ g_application_add_main_option_entries (G_APPLICATION (self), options);
+ g_application_add_option_group (G_APPLICATION (self),
+ gst_init_get_option_group ());
+
+ return self;
+}
+
+int
+main (gint argc, gchar ** argv)
+{
+ GtkPlayApp *app;
+ gint status;
+
+#if defined (GDK_WINDOWING_X11)
+ XInitThreads ();
+#endif
+
+ app = gtk_play_app_new ();
+ status = g_application_run (G_APPLICATION (app), argc, argv);;
+ g_object_unref (app);
+
+ gst_deinit ();
+ return status;
+}
diff --git a/playback/player/gtk/gtk-video-renderer.c b/playback/player/gtk/gtk-video-renderer.c
new file mode 100644
index 0000000..c62af1c
--- /dev/null
+++ b/playback/player/gtk/gtk-video-renderer.c
@@ -0,0 +1,178 @@
+/* GStreamer
+ *
+ * Copyright (C) 2015 Sebastian Dröge <sebastian@centricular.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "gtk-video-renderer.h"
+
+struct _GstPlayerGtkVideoRenderer
+{
+ GObject parent;
+
+ GstElement *sink;
+ GtkWidget *widget;
+};
+
+struct _GstPlayerGtkVideoRendererClass
+{
+ GObjectClass parent_class;
+};
+
+static void
+ gst_player_gtk_video_renderer_interface_init
+ (GstPlayerVideoRendererInterface * iface);
+
+enum
+{
+ GTK_VIDEO_RENDERER_PROP_0,
+ GTK_VIDEO_RENDERER_PROP_WIDGET,
+ GTK_VIDEO_RENDERER_PROP_LAST
+};
+
+G_DEFINE_TYPE_WITH_CODE (GstPlayerGtkVideoRenderer,
+ gst_player_gtk_video_renderer, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (GST_TYPE_PLAYER_VIDEO_RENDERER,
+ gst_player_gtk_video_renderer_interface_init));
+
+static GParamSpec
+ * gtk_video_renderer_param_specs[GTK_VIDEO_RENDERER_PROP_LAST] = { NULL, };
+
+static void
+gst_player_gtk_video_renderer_get_property (GObject * object,
+ guint prop_id, GValue * value, GParamSpec * pspec)
+{
+ GstPlayerGtkVideoRenderer *self = GST_PLAYER_GTK_VIDEO_RENDERER (object);
+
+ switch (prop_id) {
+ case GTK_VIDEO_RENDERER_PROP_WIDGET:
+ g_value_set_object (value, self->widget);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gst_player_gtk_video_renderer_finalize (GObject * object)
+{
+ GstPlayerGtkVideoRenderer *self = GST_PLAYER_GTK_VIDEO_RENDERER (object);
+
+ if (self->sink)
+ gst_object_unref (self->sink);
+ if (self->widget)
+ g_object_unref (self->widget);
+
+ G_OBJECT_CLASS
+ (gst_player_gtk_video_renderer_parent_class)->finalize (object);
+}
+
+static void
+ gst_player_gtk_video_renderer_class_init
+ (GstPlayerGtkVideoRendererClass * klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->get_property = gst_player_gtk_video_renderer_get_property;
+ gobject_class->finalize = gst_player_gtk_video_renderer_finalize;
+
+ gtk_video_renderer_param_specs
+ [GTK_VIDEO_RENDERER_PROP_WIDGET] =
+ g_param_spec_object ("widget", "Widget",
+ "Widget to render the video into", GTK_TYPE_WIDGET,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
+ g_object_class_install_properties (gobject_class,
+ GTK_VIDEO_RENDERER_PROP_LAST, gtk_video_renderer_param_specs);
+}
+
+static void
+gst_player_gtk_video_renderer_init (GstPlayerGtkVideoRenderer * self)
+{
+ GstElement *gtk_sink = gst_element_factory_make ("gtkglsink", NULL);
+
+ if (gtk_sink) {
+ GstElement *sink = gst_element_factory_make ("glsinkbin", NULL);
+ g_object_set (sink, "sink", gtk_sink, NULL);
+
+ self->sink = sink;
+ } else {
+ gtk_sink = gst_element_factory_make ("gtksink", NULL);
+
+ self->sink = gst_object_ref (gtk_sink);
+ }
+
+ g_assert (self->sink != NULL);
+
+ g_object_get (gtk_sink, "widget", &self->widget, NULL);
+ gst_object_unref (gtk_sink);
+}
+
+static GstElement *gst_player_gtk_video_renderer_create_video_sink
+ (GstPlayerVideoRenderer * iface, GstPlayer * player)
+{
+ GstPlayerGtkVideoRenderer *self = GST_PLAYER_GTK_VIDEO_RENDERER (iface);
+
+ return gst_object_ref (self->sink);
+}
+
+static void
+ gst_player_gtk_video_renderer_interface_init
+ (GstPlayerVideoRendererInterface * iface)
+{
+ iface->create_video_sink = gst_player_gtk_video_renderer_create_video_sink;
+}
+
+/**
+ * gst_player_gtk_video_renderer_new:
+ *
+ * Returns: (transfer full):
+ */
+GstPlayerVideoRenderer *
+gst_player_gtk_video_renderer_new (void)
+{
+ GstElementFactory *factory;
+
+ factory = gst_element_factory_find ("gtkglsink");
+ if (!factory)
+ factory = gst_element_factory_find ("gtksink");
+ if (!factory)
+ return NULL;
+
+ gst_object_unref (factory);
+
+ return g_object_new (GST_TYPE_PLAYER_GTK_VIDEO_RENDERER, NULL);
+}
+
+/**
+ * gst_player_gtk_video_renderer_get_widget:
+ * @self: #GstPlayerVideoRenderer instance
+ *
+ * Returns: (transfer full): The GtkWidget
+ */
+GtkWidget *gst_player_gtk_video_renderer_get_widget
+ (GstPlayerGtkVideoRenderer * self)
+{
+ GtkWidget *widget;
+
+ g_return_val_if_fail (GST_IS_PLAYER_GTK_VIDEO_RENDERER (self), NULL);
+
+ g_object_get (self, "widget", &widget, NULL);
+
+ return widget;
+}
diff --git a/playback/player/gtk/gtk-video-renderer.h b/playback/player/gtk/gtk-video-renderer.h
new file mode 100644
index 0000000..482b609
--- /dev/null
+++ b/playback/player/gtk/gtk-video-renderer.h
@@ -0,0 +1,49 @@
+/* GStreamer
+ *
+ * Copyright (C) 2015 Sebastian Dröge <sebastian@centricular.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __GTK_VIDEO_RENDERER_H__
+#define __GTK_VIDEO_RENDERER_H__
+
+#include <gst/player/player.h>
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GstPlayerGtkVideoRenderer
+ GstPlayerGtkVideoRenderer;
+typedef struct _GstPlayerGtkVideoRendererClass
+ GstPlayerGtkVideoRendererClass;
+
+#define GST_TYPE_PLAYER_GTK_VIDEO_RENDERER (gst_player_gtk_video_renderer_get_type ())
+#define GST_IS_PLAYER_GTK_VIDEO_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PLAYER_GTK_VIDEO_RENDERER))
+#define GST_IS_PLAYER_GTK_VIDEO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLAYER_GTK_VIDEO_RENDERER))
+#define GST_PLAYER_GTK_VIDEO_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PLAYER_GTK_VIDEO_RENDERER, GstPlayerGtkVideoRendererClass))
+#define GST_PLAYER_GTK_VIDEO_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLAYER_GTK_VIDEO_RENDERER, GstPlayerGtkVideoRenderer))
+#define GST_PLAYER_GTK_VIDEO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PLAYER_GTK_VIDEO_RENDERER, GstPlayerGtkVideoRendererClass))
+#define GST_PLAYER_GTK_VIDEO_RENDERER_CAST(obj) ((GstPlayerGtkVideoRenderer*)(obj))
+
+GType gst_player_gtk_video_renderer_get_type (void);
+
+GstPlayerVideoRenderer * gst_player_gtk_video_renderer_new (void);
+GtkWidget * gst_player_gtk_video_renderer_get_widget (GstPlayerGtkVideoRenderer * self);
+
+G_END_DECLS
+
+#endif /* __GTK_VIDEO_RENDERER_H__ */
diff --git a/playback/player/gtk/resources/gresources.xml b/playback/player/gtk/resources/gresources.xml
new file mode 100644
index 0000000..90b3c43
--- /dev/null
+++ b/playback/player/gtk/resources/gresources.xml
@@ -0,0 +1,11 @@
+<? xml version="1.0" encoding="UTF-8" ?>
+<gresources>
+ <gresource prefix="/ui">
+ <file>toolbar.ui</file>
+ <file>media_info_dialog.ui</file>
+ </gresource>
+ <gresource prefix="/css">
+ <file>toolbar.css</file>
+ </gresource>
+</gresources>
+
diff --git a/playback/player/gtk/resources/media_info_dialog.ui b/playback/player/gtk/resources/media_info_dialog.ui
new file mode 100644
index 0000000..fe25cf1
--- /dev/null
+++ b/playback/player/gtk/resources/media_info_dialog.ui
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.10"/>
+ <object class="GtkTreeStore" id="tree">
+ <columns>
+ <!-- column-name gchararray1 -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
+ <object class="GtkDialog" id="media_info_dialog">
+ <property name="name">media_info_dialog</property>
+ <property name="can_focus">False</property>
+ <property name="window_position">center-on-parent</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="media_info_dialog_button">
+ <property name="label" translatable="yes">Close</property>
+ <property name="name">media_info_dialog_button</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="media_info_dialog_button_clicked_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_bottom">5</property>
+ <property name="label" translatable="yes">Information about all the streams contains in your media. </property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="sw">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="margin_top">5</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="view">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="model">tree</property>
+ <property name="headers_visible">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection2"/>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="col">
+ <property name="sizing">autosize</property>
+ <property name="title" translatable="yes">col</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext1"/>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/playback/player/gtk/resources/toolbar.css b/playback/player/gtk/resources/toolbar.css
new file mode 100644
index 0000000..b967454
--- /dev/null
+++ b/playback/player/gtk/resources/toolbar.css
@@ -0,0 +1,26 @@
+* {
+ background-color: rgba(43,56,54,0.0);
+ padding: 0px;
+}
+
+GtkLabel {
+ font-size: 10px;
+ color: #ffffff;
+}
+
+#toolbar {
+ border-radius: 25px;
+ border: 3px solid #212B2A;
+ background: rgba(43,56,54,0.6);
+}
+
+GtkButton:hover {
+ border-radius: 45px;
+ background: rgba(43,56,54,1.0);
+ border: 1px solid #212B2A;
+}
+
+#title_label {
+ font-size: 12px;
+}
+
diff --git a/playback/player/gtk/resources/toolbar.ui b/playback/player/gtk/resources/toolbar.ui
new file mode 100644
index 0000000..f71e2f2
--- /dev/null
+++ b/playback/player/gtk/resources/toolbar.ui
@@ -0,0 +1,341 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.12"/>
+ <!-- interface-css-provider-path controls.css -->
+ <object class="GtkImage" id="forward_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixel_size">30</property>
+ <property name="icon_name">media-seek-forward</property>
+ <property name="icon_size">0</property>
+ </object>
+ <object class="GtkImage" id="fullscreen_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixel_size">25</property>
+ <property name="icon_name">view-fullscreen</property>
+ <property name="icon_size">0</property>
+ </object>
+ <object class="GtkImage" id="next_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixel_size">30</property>
+ <property name="icon_name">media-skip-forward</property>
+ <property name="icon_size">0</property>
+ </object>
+ <object class="GtkImage" id="pause_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixel_size">35</property>
+ <property name="icon_name">media-playback-pause</property>
+ <property name="icon_size">0</property>
+ </object>
+ <object class="GtkImage" id="play_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="pixel_size">35</property>
+ <property name="icon_name">media-playback-start</property>
+ <property name="icon_size">0</property>
+ </object>
+ <object class="GtkImage" id="prev_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixel_size">30</property>
+ <property name="icon_name">media-skip-backward</property>
+ </object>
+ <object class="GtkImage" id="restore_image">
+ <property name="name">restore_image</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixel_size">25</property>
+ <property name="icon_name">view-restore</property>
+ <property name="icon_size">0</property>
+ </object>
+ <object class="GtkImage" id="rewind_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixel_size">30</property>
+ <property name="icon_name">media-seek-backward</property>
+ </object>
+ <object class="GtkBox" id="toolbar">
+ <property name="name">toolbar</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_bottom">5</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">20</property>
+ <property name="margin_right">20</property>
+ <property name="spacing">9</property>
+ <child>
+ <object class="GtkLabel" id="elapshed_time">
+ <property name="name">elapshed_time</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">center</property>
+ <property name="label" translatable="yes">00:00</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScale" id="seekbar">
+ <property name="name">seekbar</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="valign">center</property>
+ <property name="round_digits">1</property>
+ <property name="draw_value">False</property>
+ <signal name="value-changed" handler="seekbar_value_changed_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="remain_time">
+ <property name="name">remain_time</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">center</property>
+ <property name="label" translatable="yes">00:00</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVolumeButton" id="volume_button">
+ <property name="name">volume_button</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="valign">center</property>
+ <property name="relief">none</property>
+ <property name="focus_on_click">False</property>
+ <property name="orientation">vertical</property>
+ <property name="icons">audio-volume-muted
+audio-volume-high
+audio-volume-low
+audio-volume-medium</property>
+ <signal name="value-changed" handler="volume_button_value_changed_cb" swapped="no"/>
+ <child internal-child="plus_button">
+ <object class="GtkButton" id="volumebutton-plus_button1">
+ <property name="label" translatable="yes">+</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="relief">none</property>
+ </object>
+ </child>
+ <child internal-child="minus_button">
+ <object class="GtkButton" id="volumebutton-minus_button1">
+ <property name="label" translatable="yes">-</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="relief">none</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="fullscreen_button">
+ <property name="name">fullscreen_button</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">fullscreen_image</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <signal name="toggled" handler="fullscreen_button_toggled_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">-1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="title_label">
+ <property name="name">title_label</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">5</property>
+ <property name="justify">center</property>
+ <property name="wrap">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">center</property>
+ <property name="margin_left">20</property>
+ <property name="margin_right">20</property>
+ <property name="margin_bottom">10</property>
+ <child>
+ <object class="GtkBox" id="box4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkButton" id="prev_button">
+ <property name="name">prev_button</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="valign">center</property>
+ <property name="image">prev_image</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <signal name="clicked" handler="prev_button_clicked_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="rewind_button">
+ <property name="name">rewind_button</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="image">rewind_image</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <signal name="clicked" handler="rewind_button_clicked_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="play_pause_button">
+ <property name="name">play_pause_button</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="valign">center</property>
+ <property name="image">pause_image</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <signal name="clicked" handler="play_pause_button_clicked_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="forward_button">
+ <property name="name">forward_button</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="valign">center</property>
+ <property name="image">forward_image</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <signal name="clicked" handler="forward_button_clicked_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="next_button">
+ <property name="name">next_button</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="valign">center</property>
+ <property name="image">next_image</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <signal name="clicked" handler="next_button_clicked_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="rate_label">
+ <property name="name">rate_label</property>
+ <property name="width_request">40</property>
+ <property name="can_focus">False</property>
+ <property name="valign">center</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="justify">right</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/playback/player/ios/GstPlay.xcodeproj/project.pbxproj b/playback/player/ios/GstPlay.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..6d9ff1f
--- /dev/null
+++ b/playback/player/ios/GstPlay.xcodeproj/project.pbxproj
@@ -0,0 +1,422 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 19A17EFC8D41A75E8D3DB72E /* OnlineMedia.plist in Resources */ = {isa = PBXBuildFile; fileRef = 19A176455D27298FE4041DC3 /* OnlineMedia.plist */; };
+ AD2B881F198D631B0070367B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2B881E198D631B0070367B /* Foundation.framework */; };
+ AD2B8821198D631B0070367B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2B8820198D631B0070367B /* CoreGraphics.framework */; };
+ AD2B8823198D631B0070367B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2B8822198D631B0070367B /* UIKit.framework */; };
+ AD2B8825198D631B0070367B /* GStreamer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2B8824198D631B0070367B /* GStreamer.framework */; };
+ AD2B882B198D631B0070367B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AD2B8829198D631B0070367B /* InfoPlist.strings */; };
+ AD2B882D198D631B0070367B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AD2B882C198D631B0070367B /* main.m */; };
+ AD2B8831198D631B0070367B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AD2B8830198D631B0070367B /* AppDelegate.m */; };
+ AD2B8833198D631B0070367B /* fonts.conf in Resources */ = {isa = PBXBuildFile; fileRef = AD2B8832198D631B0070367B /* fonts.conf */; };
+ AD2B8835198D631B0070367B /* Ubuntu-R.ttf in Resources */ = {isa = PBXBuildFile; fileRef = AD2B8834198D631B0070367B /* Ubuntu-R.ttf */; };
+ AD2B8837198D631B0070367B /* gst_ios_init.m in Sources */ = {isa = PBXBuildFile; fileRef = AD2B8836198D631B0070367B /* gst_ios_init.m */; };
+ AD2B8858198D637A0070367B /* EaglUIVIew.m in Sources */ = {isa = PBXBuildFile; fileRef = AD2B8857198D637A0070367B /* EaglUIVIew.m */; };
+ AD2B885B198D65470070367B /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AD2B8859198D65470070367B /* MainStoryboard_iPhone.storyboard */; };
+ AD2B885C198D65470070367B /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AD2B885A198D65470070367B /* MainStoryboard_iPad.storyboard */; };
+ AD2B8861198D65780070367B /* LibraryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AD2B885E198D65780070367B /* LibraryViewController.m */; };
+ AD2B8862198D65780070367B /* VideoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AD2B8860198D65780070367B /* VideoViewController.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 19A176455D27298FE4041DC3 /* OnlineMedia.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = OnlineMedia.plist; sourceTree = "<group>"; };
+ AD2B881B198D631B0070367B /* GstPlay.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GstPlay.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ AD2B881E198D631B0070367B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ AD2B8820198D631B0070367B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ AD2B8822198D631B0070367B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ AD2B8824198D631B0070367B /* GStreamer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GStreamer.framework; path = Library/Frameworks/GStreamer.framework; sourceTree = DEVELOPER_DIR; };
+ AD2B8828198D631B0070367B /* GstPlay-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GstPlay-Info.plist"; sourceTree = "<group>"; };
+ AD2B882A198D631B0070367B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AD2B882C198D631B0070367B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ AD2B882E198D631B0070367B /* GstPlay-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GstPlay-Prefix.pch"; sourceTree = "<group>"; };
+ AD2B882F198D631B0070367B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ AD2B8830198D631B0070367B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ AD2B8832198D631B0070367B /* fonts.conf */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = fonts.conf; sourceTree = "<group>"; };
+ AD2B8834198D631B0070367B /* Ubuntu-R.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Ubuntu-R.ttf"; sourceTree = "<group>"; };
+ AD2B8836198D631B0070367B /* gst_ios_init.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = gst_ios_init.m; sourceTree = "<group>"; };
+ AD2B8838198D631B0070367B /* gst_ios_init.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = gst_ios_init.h; sourceTree = "<group>"; };
+ AD2B8840198D631B0070367B /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
+ AD2B8856198D637A0070367B /* EaglUIVIew.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EaglUIVIew.h; sourceTree = "<group>"; };
+ AD2B8857198D637A0070367B /* EaglUIVIew.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EaglUIVIew.m; sourceTree = "<group>"; };
+ AD2B8859198D65470070367B /* MainStoryboard_iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard_iPhone.storyboard; sourceTree = "<group>"; };
+ AD2B885A198D65470070367B /* MainStoryboard_iPad.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard_iPad.storyboard; sourceTree = "<group>"; };
+ AD2B885D198D65780070367B /* LibraryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LibraryViewController.h; sourceTree = "<group>"; };
+ AD2B885E198D65780070367B /* LibraryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LibraryViewController.m; sourceTree = "<group>"; };
+ AD2B885F198D65780070367B /* VideoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoViewController.h; sourceTree = "<group>"; };
+ AD2B8860198D65780070367B /* VideoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoViewController.m; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ AD2B8818198D631B0070367B /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AD2B8821198D631B0070367B /* CoreGraphics.framework in Frameworks */,
+ AD2B8825198D631B0070367B /* GStreamer.framework in Frameworks */,
+ AD2B8823198D631B0070367B /* UIKit.framework in Frameworks */,
+ AD2B881F198D631B0070367B /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ AD2B8812198D631B0070367B = {
+ isa = PBXGroup;
+ children = (
+ AD2B8826198D631B0070367B /* GstPlay */,
+ AD2B881D198D631B0070367B /* Frameworks */,
+ AD2B881C198D631B0070367B /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ AD2B881C198D631B0070367B /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ AD2B881B198D631B0070367B /* GstPlay.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ AD2B881D198D631B0070367B /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ AD2B881E198D631B0070367B /* Foundation.framework */,
+ AD2B8820198D631B0070367B /* CoreGraphics.framework */,
+ AD2B8822198D631B0070367B /* UIKit.framework */,
+ AD2B8824198D631B0070367B /* GStreamer.framework */,
+ AD2B8840198D631B0070367B /* XCTest.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ AD2B8826198D631B0070367B /* GstPlay */ = {
+ isa = PBXGroup;
+ children = (
+ AD2B8856198D637A0070367B /* EaglUIVIew.h */,
+ AD2B8857198D637A0070367B /* EaglUIVIew.m */,
+ AD2B882F198D631B0070367B /* AppDelegate.h */,
+ AD2B8830198D631B0070367B /* AppDelegate.m */,
+ AD2B8859198D65470070367B /* MainStoryboard_iPhone.storyboard */,
+ AD2B885A198D65470070367B /* MainStoryboard_iPad.storyboard */,
+ AD2B885D198D65780070367B /* LibraryViewController.h */,
+ AD2B885E198D65780070367B /* LibraryViewController.m */,
+ AD2B885F198D65780070367B /* VideoViewController.h */,
+ AD2B8860198D65780070367B /* VideoViewController.m */,
+ AD2B8827198D631B0070367B /* Supporting Files */,
+ 19A176455D27298FE4041DC3 /* OnlineMedia.plist */,
+ );
+ path = GstPlay;
+ sourceTree = "<group>";
+ };
+ AD2B8827198D631B0070367B /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ AD2B8828198D631B0070367B /* GstPlay-Info.plist */,
+ AD2B8829198D631B0070367B /* InfoPlist.strings */,
+ AD2B882C198D631B0070367B /* main.m */,
+ AD2B882E198D631B0070367B /* GstPlay-Prefix.pch */,
+ AD2B8832198D631B0070367B /* fonts.conf */,
+ AD2B8834198D631B0070367B /* Ubuntu-R.ttf */,
+ AD2B8836198D631B0070367B /* gst_ios_init.m */,
+ AD2B8838198D631B0070367B /* gst_ios_init.h */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ AD2B881A198D631B0070367B /* GstPlay */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = AD2B8850198D631B0070367B /* Build configuration list for PBXNativeTarget "GstPlay" */;
+ buildPhases = (
+ AD2B8817198D631B0070367B /* Sources */,
+ AD2B8818198D631B0070367B /* Frameworks */,
+ AD2B8819198D631B0070367B /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = GstPlay;
+ productName = GstPlay;
+ productReference = AD2B881B198D631B0070367B /* GstPlay.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ AD2B8813198D631B0070367B /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0510;
+ ORGANIZATIONNAME = "Sebastian Dröge";
+ };
+ buildConfigurationList = AD2B8816198D631B0070367B /* Build configuration list for PBXProject "GstPlay" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = AD2B8812198D631B0070367B;
+ productRefGroup = AD2B881C198D631B0070367B /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ AD2B881A198D631B0070367B /* GstPlay */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ AD2B8819198D631B0070367B /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AD2B885C198D65470070367B /* MainStoryboard_iPad.storyboard in Resources */,
+ AD2B885B198D65470070367B /* MainStoryboard_iPhone.storyboard in Resources */,
+ AD2B8835198D631B0070367B /* Ubuntu-R.ttf in Resources */,
+ AD2B8833198D631B0070367B /* fonts.conf in Resources */,
+ AD2B882B198D631B0070367B /* InfoPlist.strings in Resources */,
+ 19A17EFC8D41A75E8D3DB72E /* OnlineMedia.plist in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ AD2B8817198D631B0070367B /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AD2B8861198D65780070367B /* LibraryViewController.m in Sources */,
+ AD2B8831198D631B0070367B /* AppDelegate.m in Sources */,
+ AD2B8862198D65780070367B /* VideoViewController.m in Sources */,
+ AD2B8858198D637A0070367B /* EaglUIVIew.m in Sources */,
+ AD2B882D198D631B0070367B /* main.m in Sources */,
+ AD2B8837198D631B0070367B /* gst_ios_init.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ AD2B8829198D631B0070367B /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ AD2B882A198D631B0070367B /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ AD2B884E198D631B0070367B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 6.1;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ AD2B884F198D631B0070367B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = YES;
+ ENABLE_NS_ASSERTIONS = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 6.1;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ AD2B8851198D631B0070367B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = armv7;
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
+ FRAMEWORK_SEARCH_PATHS = (
+ "~/Library/Developer/GStreamer/iPhone.sdk",
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ );
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "GstPlay/GstPlay-Prefix.pch";
+ HEADER_SEARCH_PATHS = (
+ "\"~/Library/Developer/GStreamer/iPhone.sdk/GStreamer.framework/Headers\"",
+ ../lib,
+ );
+ INFOPLIST_FILE = "GstPlay/GstPlay-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.1;
+ OTHER_LDFLAGS = (
+ "-lresolv",
+ "-lstdc++",
+ "-framework",
+ CoreFoundation,
+ "-framework",
+ Foundation,
+ "-framework",
+ AVFoundation,
+ "-framework",
+ CoreMedia,
+ "-framework",
+ CoreVideo,
+ "-framework",
+ CoreAudio,
+ "-framework",
+ AudioToolbox,
+ "-weak_framework",
+ VideoToolbox,
+ "-framework",
+ OpenGLES,
+ "-framework",
+ AssetsLibrary,
+ "-framework",
+ QuartzCore,
+ "-framework",
+ AssetsLibrary,
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ AD2B8852198D631B0070367B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = armv7;
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
+ FRAMEWORK_SEARCH_PATHS = (
+ "~/Library/Developer/GStreamer/iPhone.sdk",
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ );
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "GstPlay/GstPlay-Prefix.pch";
+ HEADER_SEARCH_PATHS = (
+ "\"~/Library/Developer/GStreamer/iPhone.sdk/GStreamer.framework/Headers\"",
+ ../lib,
+ );
+ INFOPLIST_FILE = "GstPlay/GstPlay-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.1;
+ OTHER_LDFLAGS = (
+ "-lresolv",
+ "-lstdc++",
+ "-framework",
+ CoreFoundation,
+ "-framework",
+ Foundation,
+ "-framework",
+ AVFoundation,
+ "-framework",
+ CoreMedia,
+ "-framework",
+ CoreVideo,
+ "-framework",
+ CoreAudio,
+ "-framework",
+ AudioToolbox,
+ "-weak_framework",
+ VideoToolbox,
+ "-framework",
+ OpenGLES,
+ "-framework",
+ AssetsLibrary,
+ "-framework",
+ QuartzCore,
+ "-framework",
+ AssetsLibrary,
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ AD2B8816198D631B0070367B /* Build configuration list for PBXProject "GstPlay" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ AD2B884E198D631B0070367B /* Debug */,
+ AD2B884F198D631B0070367B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ AD2B8850198D631B0070367B /* Build configuration list for PBXNativeTarget "GstPlay" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ AD2B8851198D631B0070367B /* Debug */,
+ AD2B8852198D631B0070367B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = AD2B8813198D631B0070367B /* Project object */;
+}
diff --git a/playback/player/ios/GstPlay.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/playback/player/ios/GstPlay.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..955a731
--- /dev/null
+++ b/playback/player/ios/GstPlay.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:GstPlay.xcodeproj">
+ </FileRef>
+</Workspace>
diff --git a/playback/player/ios/GstPlay.xcodeproj/xcuserdata/slomo.xcuserdatad/xcschemes/GstPlay.xcscheme b/playback/player/ios/GstPlay.xcodeproj/xcuserdata/slomo.xcuserdatad/xcschemes/GstPlay.xcscheme
new file mode 100644
index 0000000..c536703
--- /dev/null
+++ b/playback/player/ios/GstPlay.xcodeproj/xcuserdata/slomo.xcuserdatad/xcschemes/GstPlay.xcscheme
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0510"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "AD2B881A198D631B0070367B"
+ BuildableName = "GstPlay.app"
+ BlueprintName = "GstPlay"
+ ReferencedContainer = "container:GstPlay.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "AD2B883E198D631B0070367B"
+ BuildableName = "GstPlayTests.xctest"
+ BlueprintName = "GstPlayTests"
+ ReferencedContainer = "container:GstPlay.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "AD2B881A198D631B0070367B"
+ BuildableName = "GstPlay.app"
+ BlueprintName = "GstPlay"
+ ReferencedContainer = "container:GstPlay.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "AD2B881A198D631B0070367B"
+ BuildableName = "GstPlay.app"
+ BlueprintName = "GstPlay"
+ ReferencedContainer = "container:GstPlay.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "AD2B881A198D631B0070367B"
+ BuildableName = "GstPlay.app"
+ BlueprintName = "GstPlay"
+ ReferencedContainer = "container:GstPlay.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/playback/player/ios/GstPlay.xcodeproj/xcuserdata/slomo.xcuserdatad/xcschemes/xcschememanagement.plist b/playback/player/ios/GstPlay.xcodeproj/xcuserdata/slomo.xcuserdatad/xcschemes/xcschememanagement.plist
new file mode 100644
index 0000000..c980ecf
--- /dev/null
+++ b/playback/player/ios/GstPlay.xcodeproj/xcuserdata/slomo.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SchemeUserState</key>
+ <dict>
+ <key>GstPlay.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>AD2B881A198D631B0070367B</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ <key>AD2B883E198D631B0070367B</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
diff --git a/playback/player/ios/GstPlay/AppDelegate.h b/playback/player/ios/GstPlay/AppDelegate.h
new file mode 100644
index 0000000..767a22d
--- /dev/null
+++ b/playback/player/ios/GstPlay/AppDelegate.h
@@ -0,0 +1,15 @@
+//
+// AppDelegate.h
+// GstPlay
+//
+// Created by Sebastian Dröge on 02/08/14.
+// Copyright (c) 2014 Sebastian Dröge. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
diff --git a/playback/player/ios/GstPlay/AppDelegate.m b/playback/player/ios/GstPlay/AppDelegate.m
new file mode 100644
index 0000000..cb500b2
--- /dev/null
+++ b/playback/player/ios/GstPlay/AppDelegate.m
@@ -0,0 +1,45 @@
+//
+// AppDelegate.m
+// GstPlay
+//
+// Created by Sebastian Dröge on 02/08/14.
+// Copyright (c) 2014 Sebastian Dröge. All rights reserved.
+//
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+@end
diff --git a/playback/player/ios/GstPlay/EaglUIVIew.h b/playback/player/ios/GstPlay/EaglUIVIew.h
new file mode 100644
index 0000000..ac4e798
--- /dev/null
+++ b/playback/player/ios/GstPlay/EaglUIVIew.h
@@ -0,0 +1,11 @@
+#import <Foundation/Foundation.h>
+#import <QuartzCore/QuartzCore.h>
+#include <OpenGLES/ES2/gl.h>
+#include <OpenGLES/ES2/glext.h>
+
+@interface EaglUIView : UIView
+{
+}
+
+@end
+
diff --git a/playback/player/ios/GstPlay/EaglUIVIew.m b/playback/player/ios/GstPlay/EaglUIVIew.m
new file mode 100644
index 0000000..91cdd9d
--- /dev/null
+++ b/playback/player/ios/GstPlay/EaglUIVIew.m
@@ -0,0 +1,13 @@
+#import "EaglUIVIew.h"
+
+#import <QuartzCore/QuartzCore.h>
+
+@implementation EaglUIView
+
+
++ (Class) layerClass
+{
+ return [CAEAGLLayer class];
+}
+
+@end
diff --git a/playback/player/ios/GstPlay/GstPlay-Info.plist b/playback/player/ios/GstPlay/GstPlay-Info.plist
new file mode 100644
index 0000000..180da25
--- /dev/null
+++ b/playback/player/ios/GstPlay/GstPlay-Info.plist
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.freedesktop.gstreamer.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIMainStoryboardFile</key>
+ <string>MainStoryboard_iPhone</string>
+ <key>UIMainStoryboardFile~ipad</key>
+ <string>MainStoryboard_iPad</string>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
diff --git a/playback/player/ios/GstPlay/GstPlay-Prefix.pch b/playback/player/ios/GstPlay/GstPlay-Prefix.pch
new file mode 100644
index 0000000..743435c
--- /dev/null
+++ b/playback/player/ios/GstPlay/GstPlay-Prefix.pch
@@ -0,0 +1,16 @@
+//
+// Prefix header
+//
+// The contents of this file are implicitly included at the beginning of every source file.
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_3_0
+#warning "This project uses features only available in iOS SDK 3.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
diff --git a/playback/player/ios/GstPlay/LibraryViewController.h b/playback/player/ios/GstPlay/LibraryViewController.h
new file mode 100644
index 0000000..6950b19
--- /dev/null
+++ b/playback/player/ios/GstPlay/LibraryViewController.h
@@ -0,0 +1,12 @@
+#import <UIKit/UIKit.h>
+
+@interface LibraryViewController : UITableViewController
+{
+ NSArray *libraryEntries;
+ NSArray *mediaEntries;
+ NSArray *onlineEntries;
+}
+
+- (IBAction)refresh:(id)sender;
+
+@end
diff --git a/playback/player/ios/GstPlay/LibraryViewController.m b/playback/player/ios/GstPlay/LibraryViewController.m
new file mode 100644
index 0000000..330328f
--- /dev/null
+++ b/playback/player/ios/GstPlay/LibraryViewController.m
@@ -0,0 +1,136 @@
+#import "LibraryViewController.h"
+#import "VideoViewController.h"
+#import <AssetsLibrary/AssetsLibrary.h>
+
+@interface LibraryViewController ()
+
+@end
+
+@implementation LibraryViewController
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+ [super setTitle:@"Library"];
+ [self refreshMediaItems];
+}
+
+- (IBAction)refresh:(id)sender
+{
+ [self refreshMediaItems];
+ [self.tableView reloadData];
+}
+
+static NSString *CellIdentifier = @"CellIdentifier";
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+ return 3;
+}
+
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
+{
+ switch (section)
+ {
+ case 0: return @"Photo library";
+ case 1: return @"iTunes file sharing";
+ default: return @"Online files";
+ }
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+ switch (section) {
+ case 0:
+ return [self->libraryEntries count];
+ case 1:
+ return [self->mediaEntries count];
+ case 2:
+ return [self->onlineEntries count];
+ default:
+ return 0;
+ }
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
+ // Configure Cell
+ UILabel *title = (UILabel *)[cell.contentView viewWithTag:10];
+ UILabel *subtitle = (UILabel *)[cell.contentView viewWithTag:11];
+
+ switch (indexPath.section) {
+ case 0: subtitle.text = [self->libraryEntries objectAtIndex:indexPath.item];
+ break;
+ case 1: subtitle.text = [self->mediaEntries objectAtIndex:indexPath.item];
+ break;
+ case 2: subtitle.text = [self->onlineEntries objectAtIndex:indexPath.item];
+ break;
+ default:
+ break;
+ }
+
+ NSArray *components = [subtitle.text pathComponents];
+ title.text = components.lastObject;
+
+ return cell;
+}
+
+- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
+ return NO;
+}
+
+- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
+ return NO;
+}
+
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+ if ([segue.identifier isEqualToString:@"playVideo"]) {
+ NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
+ VideoViewController *destViewController = segue.destinationViewController;
+ UITableViewCell *cell = [[self tableView] cellForRowAtIndexPath:indexPath];
+ UILabel *label = (UILabel *)[cell.contentView viewWithTag:10];
+ destViewController.title = label.text;
+ label = (UILabel *)[cell.contentView viewWithTag:11];
+ destViewController.uri = label.text;
+ }
+}
+
+- (void)refreshMediaItems {
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSAllDomainsMask, YES);
+ NSString *docsPath = [paths objectAtIndex:0];
+
+ /* Entries from the Photo Library */
+ NSMutableArray *entries = [[NSMutableArray alloc] init];
+ ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
+ [library enumerateGroupsWithTypes:ALAssetsGroupAll
+ usingBlock:^(ALAssetsGroup *group, BOOL *stop)
+ {
+ if (group) {
+ [group enumerateAssetsUsingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop)
+ {
+ if(result) {
+ [entries addObject:[NSString stringWithFormat:@"%@",[result valueForProperty:ALAssetPropertyAssetURL]]];
+ *stop = NO;
+
+ }
+ }];
+ } else {
+ [self.tableView reloadData];
+ }
+ }
+ failureBlock:^(NSError *error)
+ {
+ NSLog(@"ERROR");
+ }
+ ];
+ self->libraryEntries = entries;
+
+ /* Retrieve entries from iTunes file sharing */
+ entries = [[NSMutableArray alloc] init];
+ for (NSString *e in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:docsPath error:nil])
+ {
+ [entries addObject:[NSString stringWithFormat:@"file://%@/%@", docsPath, e]];
+ }
+ self->mediaEntries = entries;
+ self->onlineEntries = [NSArray arrayWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"OnlineMedia" withExtension:@"plist"]];
+}
+
+@end
diff --git a/playback/player/ios/GstPlay/MainStoryboard_iPad.storyboard b/playback/player/ios/GstPlay/MainStoryboard_iPad.storyboard
new file mode 100644
index 0000000..d1ea519
--- /dev/null
+++ b/playback/player/ios/GstPlay/MainStoryboard_iPad.storyboard
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="13E28" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="b7k-ZL-0G1">
+ <dependencies>
+ <deployment defaultVersion="1552" identifier="iOS"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
+ </dependencies>
+ <scenes>
+ <!--Navigation Controller-->
+ <scene sceneID="3gA-ZI-2k3">
+ <objects>
+ <navigationController definesPresentationContext="YES" id="b7k-ZL-0G1" sceneMemberID="viewController">
+ <navigationBar key="navigationBar" contentMode="scaleToFill" id="zhK-zc-ohc">
+ <autoresizingMask key="autoresizingMask"/>
+ </navigationBar>
+ <connections>
+ <segue destination="VW0-ax-bPv" kind="relationship" relationship="rootViewController" id="bWs-EK-FdN"/>
+ </connections>
+ </navigationController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="Sqh-T0-zkr" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="-1459" y="-199"/>
+ </scene>
+ <!--VideoViewController-->
+ <scene sceneID="P93-nn-HBJ">
+ <objects>
+ <viewController title="Playback" id="z7O-8l-Zeo" userLabel="VideoViewController" customClass="VideoViewController" sceneMemberID="viewController">
+ <layoutGuides>
+ <viewControllerLayoutGuide type="top" id="tYu-BR-4pC"/>
+ <viewControllerLayoutGuide type="bottom" id="gDN-cX-tzD"/>
+ </layoutGuides>
+ <view key="view" contentMode="scaleToFill" id="CqS-Gu-I1O">
+ <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <view contentMode="scaleToFill" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xWd-bg-0b6" userLabel="VideoContainer">
+ <rect key="frame" x="0.0" y="0.0" width="768" height="959"/>
+ <subviews>
+ <view contentMode="scaleToFill" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6tN-97-YoQ" userLabel="Video" customClass="EaglUIView">
+ <rect key="frame" x="224" y="360" width="320" height="240"/>
+ <color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
+ <constraints>
+ <constraint firstAttribute="height" constant="240" id="A9A-eK-7QX"/>
+ <constraint firstAttribute="width" constant="320" id="xcj-6M-2KJ"/>
+ </constraints>
+ </view>
+ </subviews>
+ <color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
+ <constraints>
+ <constraint firstAttribute="centerY" secondItem="6tN-97-YoQ" secondAttribute="centerY" id="UYa-oM-cdf"/>
+ <constraint firstAttribute="centerX" secondItem="6tN-97-YoQ" secondAttribute="centerX" id="w9H-W0-MfF"/>
+ </constraints>
+ </view>
+ <toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MUi-CE-Ydy">
+ <rect key="frame" x="0.0" y="980" width="768" height="44"/>
+ <constraints>
+ <constraint firstAttribute="height" constant="44" id="EwL-Ma-A4v"/>
+ </constraints>
+ <items>
+ <barButtonItem systemItem="play" id="UlF-Ga-2VX">
+ <connections>
+ <action selector="play:" destination="z7O-8l-Zeo" id="5xC-uv-9lM"/>
+ </connections>
+ </barButtonItem>
+ <barButtonItem systemItem="pause" id="J3O-8j-Tkt">
+ <connections>
+ <action selector="pause:" destination="z7O-8l-Zeo" id="BYM-2X-Tel"/>
+ </connections>
+ </barButtonItem>
+ <barButtonItem style="plain" id="s39-nx-e0L">
+ <textField key="customView" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="00:00:00 / 00:00:00" borderStyle="roundedRect" textAlignment="center" minimumFontSize="17" id="G8q-Tu-Qx0" userLabel="Time">
+ <rect key="frame" x="67" y="7" width="140" height="30"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <fontDescription key="fontDescription" type="system" pointSize="14"/>
+ <textInputTraits key="textInputTraits"/>
+ </textField>
+ </barButtonItem>
+ <barButtonItem style="plain" id="2n0-TO-8Ss">
+ <slider key="customView" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" minValue="0.0" maxValue="1" id="ufs-E5-87w" userLabel="Slider">
+ <rect key="frame" x="217" y="11" width="118" height="23"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <connections>
+ <action selector="sliderTouchDown:" destination="z7O-8l-Zeo" eventType="touchDown" id="yV6-eN-VUb"/>
+ <action selector="sliderTouchUp:" destination="z7O-8l-Zeo" eventType="touchCancel" id="OyS-WZ-sEk"/>
+ <action selector="sliderTouchUp:" destination="z7O-8l-Zeo" eventType="touchUpOutside" id="Vfz-se-pJg"/>
+ <action selector="sliderTouchUp:" destination="z7O-8l-Zeo" eventType="touchUpInside" id="kZF-uW-GRo"/>
+ <action selector="sliderValueChanged:" destination="z7O-8l-Zeo" eventType="valueChanged" id="cwm-pm-BfT"/>
+ </connections>
+ </slider>
+ </barButtonItem>
+ </items>
+ </toolbar>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <constraints>
+ <constraint firstItem="MUi-CE-Ydy" firstAttribute="trailing" secondItem="CqS-Gu-I1O" secondAttribute="trailing" constant="20" symbolic="YES" id="4vm-hF-9E8"/>
+ <constraint firstItem="xWd-bg-0b6" firstAttribute="top" secondItem="CqS-Gu-I1O" secondAttribute="top" id="MXr-HK-07f"/>
+ <constraint firstAttribute="trailing" secondItem="xWd-bg-0b6" secondAttribute="trailing" id="NGT-7D-rHD"/>
+ <constraint firstItem="MUi-CE-Ydy" firstAttribute="leading" secondItem="CqS-Gu-I1O" secondAttribute="leading" constant="20" symbolic="YES" id="OM9-gE-OVP"/>
+ <constraint firstItem="xWd-bg-0b6" firstAttribute="leading" secondItem="CqS-Gu-I1O" secondAttribute="leading" id="XO5-WJ-Y3R"/>
+ <constraint firstItem="MUi-CE-Ydy" firstAttribute="bottom" secondItem="CqS-Gu-I1O" secondAttribute="bottom" constant="20" symbolic="YES" id="w6K-xy-EJe"/>
+ </constraints>
+ </view>
+ <navigationItem key="navigationItem" id="fGF-kQ-bge"/>
+ <simulatedOrientationMetrics key="simulatedOrientationMetrics"/>
+ <connections>
+ <outlet property="pause_button" destination="J3O-8j-Tkt" id="Dls-sg-FPm"/>
+ <outlet property="play_button" destination="UlF-Ga-2VX" id="243-yq-GEe"/>
+ <outlet property="time_label" destination="G8q-Tu-Qx0" id="jpR-6u-zp0"/>
+ <outlet property="time_slider" destination="ufs-E5-87w" id="ZUd-jO-4qN"/>
+ <outlet property="toolbar" destination="MUi-CE-Ydy" id="Lme-0P-4Xq"/>
+ <outlet property="video_container_view" destination="xWd-bg-0b6" id="7dL-Mp-QGc"/>
+ <outlet property="video_height_constraint" destination="A9A-eK-7QX" id="rMe-ze-8l5"/>
+ <outlet property="video_view" destination="6tN-97-YoQ" id="Q0n-dR-hqv"/>
+ <outlet property="video_width_constraint" destination="xcj-6M-2KJ" id="oTt-9z-KCW"/>
+ </connections>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="iRS-GG-bR6" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="439" y="-199"/>
+ </scene>
+ <!--LibraryViewController-->
+ <scene sceneID="bq0-Ch-DBo">
+ <objects>
+ <tableViewController title="Library" id="VW0-ax-bPv" userLabel="LibraryViewController" customClass="LibraryViewController" sceneMemberID="viewController">
+ <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="hAr-jJ-10J">
+ <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
+ <prototypes>
+ <tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="CellIdentifier" textLabel="HoX-KW-H9G" detailTextLabel="iD6-8p-XIU" style="IBUITableViewCellStyleSubtitle" id="ujV-TF-eMq">
+ <rect key="frame" x="0.0" y="119" width="768" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ujV-TF-eMq" id="SAN-nE-evy">
+ <rect key="frame" x="0.0" y="0.0" width="735" height="43"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <subviews>
+ <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" tag="10" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="HoX-KW-H9G">
+ <rect key="frame" x="15" y="2" width="36" height="22"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+ </label>
+ <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" tag="11" contentMode="left" text="Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="iD6-8p-XIU">
+ <rect key="frame" x="15" y="24" width="50" height="17"/>
+ <fontDescription key="fontDescription" type="system" pointSize="14"/>
+ <color key="textColor" red="0.50196078431372548" green="0.50196078431372548" blue="0.50196078431372548" alpha="1" colorSpace="calibratedRGB"/>
+ <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+ </label>
+ </subviews>
+ </tableViewCellContentView>
+ <connections>
+ <segue destination="z7O-8l-Zeo" kind="push" identifier="playVideo" id="wKB-w6-zJS"/>
+ </connections>
+ </tableViewCell>
+ </prototypes>
+ <connections>
+ <outlet property="dataSource" destination="VW0-ax-bPv" id="9qF-zP-TH5"/>
+ <outlet property="delegate" destination="VW0-ax-bPv" id="9Ss-rm-lAe"/>
+ </connections>
+ </tableView>
+ <navigationItem key="navigationItem" id="G3n-WN-bmw">
+ <barButtonItem key="rightBarButtonItem" systemItem="refresh" id="Gpf-LU-6E1" userLabel="Refresh">
+ <connections>
+ <action selector="refresh:" destination="VW0-ax-bPv" id="nUp-eS-LmM"/>
+ </connections>
+ </barButtonItem>
+ </navigationItem>
+ </tableViewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="7RK-lx-45a" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="-478" y="-199"/>
+ </scene>
+ </scenes>
+ <simulatedMetricsContainer key="defaultSimulatedMetrics">
+ <simulatedStatusBarMetrics key="statusBar"/>
+ <simulatedOrientationMetrics key="orientation"/>
+ <simulatedScreenMetrics key="destination"/>
+ </simulatedMetricsContainer>
+</document>
diff --git a/playback/player/ios/GstPlay/MainStoryboard_iPhone.storyboard b/playback/player/ios/GstPlay/MainStoryboard_iPhone.storyboard
new file mode 100644
index 0000000..8f43065
--- /dev/null
+++ b/playback/player/ios/GstPlay/MainStoryboard_iPhone.storyboard
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="z4I-U6-JHy">
+ <dependencies>
+ <deployment defaultVersion="1552" identifier="iOS"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
+ </dependencies>
+ <scenes>
+ <!--Navigation Controller-->
+ <scene sceneID="2zM-sj-9dA">
+ <objects>
+ <navigationController definesPresentationContext="YES" id="z4I-U6-JHy" sceneMemberID="viewController">
+ <simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
+ <navigationBar key="navigationBar" contentMode="scaleToFill" id="eHD-Ir-W2J">
+ <autoresizingMask key="autoresizingMask"/>
+ </navigationBar>
+ <connections>
+ <segue destination="bdY-7c-pia" kind="relationship" relationship="rootViewController" id="2oM-BQ-UIl"/>
+ </connections>
+ </navigationController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="7VH-OE-ZqU" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="-1459" y="-199"/>
+ </scene>
+ <!--VideoViewController-->
+ <scene sceneID="cnz-j4-g9W">
+ <objects>
+ <viewController title="Playback" id="iMo-Z9-PrL" userLabel="VideoViewController" customClass="VideoViewController" sceneMemberID="viewController">
+ <layoutGuides>
+ <viewControllerLayoutGuide type="top" id="amE-tW-f07"/>
+ <viewControllerLayoutGuide type="bottom" id="uvN-Av-Fcm"/>
+ </layoutGuides>
+ <view key="view" contentMode="scaleToFill" id="zgN-eK-M4Q">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nA3-W2-kn7" userLabel="VideoContainer">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="481"/>
+ <subviews>
+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WHW-sv-bWc" userLabel="Video" customClass="EaglUIView">
+ <rect key="frame" x="0.0" y="121" width="320" height="240"/>
+ <color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
+ <constraints>
+ <constraint firstAttribute="height" constant="240" id="5z2-ux-czd"/>
+ <constraint firstAttribute="width" constant="320" id="76i-Rz-yha"/>
+ </constraints>
+ </view>
+ </subviews>
+ <color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
+ <constraints>
+ <constraint firstAttribute="centerY" secondItem="WHW-sv-bWc" secondAttribute="centerY" id="3wK-Zr-bQY"/>
+ <constraint firstAttribute="centerX" secondItem="WHW-sv-bWc" secondAttribute="centerX" id="X5U-dh-PaZ"/>
+ </constraints>
+ </view>
+ <toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="A2w-65-QSF">
+ <rect key="frame" x="0.0" y="524" width="320" height="44"/>
+ <constraints>
+ <constraint firstAttribute="height" constant="44" id="apr-w6-VYs"/>
+ </constraints>
+ <items>
+ <barButtonItem style="plain" systemItem="flexibleSpace" id="Ixt-So-LpU"/>
+ <barButtonItem systemItem="play" id="8Yb-MS-rAF">
+ <connections>
+ <action selector="play:" destination="iMo-Z9-PrL" id="9nM-or-ZY7"/>
+ </connections>
+ </barButtonItem>
+ <barButtonItem systemItem="pause" id="nH5-s3-C0i">
+ <connections>
+ <action selector="pause:" destination="iMo-Z9-PrL" id="mef-Ij-Agl"/>
+ </connections>
+ </barButtonItem>
+ <barButtonItem style="plain" id="VUJ-y8-aWS">
+ <textField key="customView" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="00:00:00 / 00:00:00" borderStyle="roundedRect" textAlignment="center" minimumFontSize="17" id="R6T-PH-VPd" userLabel="Time">
+ <rect key="frame" x="116" y="7" width="139" height="30"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="system" pointSize="14"/>
+ <textInputTraits key="textInputTraits"/>
+ </textField>
+ </barButtonItem>
+ <barButtonItem style="plain" systemItem="flexibleSpace" id="LSl-TA-0qV"/>
+ </items>
+ </toolbar>
+ <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="4Ns-t9-gs7" userLabel="Slider">
+ <rect key="frame" x="-2" y="493" width="324" height="31"/>
+ <connections>
+ <action selector="sliderTouchDown:" destination="iMo-Z9-PrL" eventType="touchDown" id="jGO-Pw-b5d"/>
+ <action selector="sliderTouchUp:" destination="iMo-Z9-PrL" eventType="touchCancel" id="L1U-aK-FFn"/>
+ <action selector="sliderTouchUp:" destination="iMo-Z9-PrL" eventType="touchUpInside" id="jRZ-vw-FQR"/>
+ <action selector="sliderTouchUp:" destination="iMo-Z9-PrL" eventType="touchUpOutside" id="u1u-UD-WJw"/>
+ <action selector="sliderValueChanged:" destination="iMo-Z9-PrL" eventType="valueChanged" id="ZOq-XS-0M1"/>
+ </connections>
+ </slider>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <constraints>
+ <constraint firstItem="A2w-65-QSF" firstAttribute="leading" secondItem="zgN-eK-M4Q" secondAttribute="leading" constant="20" symbolic="YES" id="Aki-Hx-2C9"/>
+ <constraint firstItem="4Ns-t9-gs7" firstAttribute="trailing" secondItem="zgN-eK-M4Q" secondAttribute="trailing" id="HFi-uV-wdo"/>
+ <constraint firstAttribute="bottom" secondItem="nA3-W2-kn7" secondAttribute="bottom" constant="87" id="Jdn-RD-NPI"/>
+ <constraint firstItem="A2w-65-QSF" firstAttribute="trailing" secondItem="zgN-eK-M4Q" secondAttribute="trailing" constant="20" symbolic="YES" id="WWj-l6-D2k"/>
+ <constraint firstItem="A2w-65-QSF" firstAttribute="bottom" secondItem="zgN-eK-M4Q" secondAttribute="bottom" id="e3s-lP-iPh"/>
+ <constraint firstAttribute="trailing" secondItem="nA3-W2-kn7" secondAttribute="trailing" id="lOJ-ew-ZyI"/>
+ <constraint firstItem="nA3-W2-kn7" firstAttribute="top" secondItem="zgN-eK-M4Q" secondAttribute="top" id="lUb-ik-h6u"/>
+ <constraint firstItem="4Ns-t9-gs7" firstAttribute="leading" secondItem="zgN-eK-M4Q" secondAttribute="leading" id="ma4-AV-cQs"/>
+ <constraint firstItem="nA3-W2-kn7" firstAttribute="leading" secondItem="zgN-eK-M4Q" secondAttribute="leading" id="p8G-QE-uZ8"/>
+ <constraint firstAttribute="bottom" secondItem="4Ns-t9-gs7" secondAttribute="bottom" constant="45" id="qfD-gf-vLB"/>
+ </constraints>
+ </view>
+ <navigationItem key="navigationItem" id="xMw-um-vMA"/>
+ <simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
+ <simulatedOrientationMetrics key="simulatedOrientationMetrics"/>
+ <connections>
+ <outlet property="pause_button" destination="nH5-s3-C0i" id="VWV-EW-jB6"/>
+ <outlet property="play_button" destination="8Yb-MS-rAF" id="5SI-l2-mAJ"/>
+ <outlet property="time_label" destination="R6T-PH-VPd" id="bGs-Zr-rv3"/>
+ <outlet property="time_slider" destination="4Ns-t9-gs7" id="9Ne-1N-clc"/>
+ <outlet property="video_container_view" destination="nA3-W2-kn7" id="lEY-hP-YHD"/>
+ <outlet property="video_height_constraint" destination="5z2-ux-czd" id="9R7-fg-G0e"/>
+ <outlet property="video_view" destination="WHW-sv-bWc" id="c6W-td-a74"/>
+ <outlet property="video_width_constraint" destination="76i-Rz-yha" id="vSP-Kk-v8g"/>
+ </connections>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="YOs-uD-FMw" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="-609" y="-199"/>
+ </scene>
+ <!--LibraryViewController-->
+ <scene sceneID="5eb-Di-aQ1">
+ <objects>
+ <tableViewController title="Library" id="bdY-7c-pia" userLabel="LibraryViewController" customClass="LibraryViewController" sceneMemberID="viewController">
+ <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="4vG-QM-31k">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
+ <prototypes>
+ <tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="CellIdentifier" textLabel="QLZ-ec-hHM" detailTextLabel="kAu-kE-DrP" style="IBUITableViewCellStyleSubtitle" id="nmS-s6-sIj">
+ <rect key="frame" x="0.0" y="119" width="320" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="nmS-s6-sIj" id="P61-er-gaf">
+ <rect key="frame" x="0.0" y="0.0" width="287" height="43"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <subviews>
+ <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" tag="10" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="QLZ-ec-hHM">
+ <rect key="frame" x="15" y="2" width="36" height="22"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+ </label>
+ <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" tag="11" contentMode="left" text="Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="kAu-kE-DrP">
+ <rect key="frame" x="15" y="24" width="50" height="17"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <fontDescription key="fontDescription" type="system" pointSize="14"/>
+ <color key="textColor" red="0.50196078430000002" green="0.50196078430000002" blue="0.50196078430000002" alpha="1" colorSpace="calibratedRGB"/>
+ <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+ </label>
+ </subviews>
+ </tableViewCellContentView>
+ <connections>
+ <segue destination="iMo-Z9-PrL" kind="push" identifier="playVideo" id="jW0-JJ-SqQ"/>
+ </connections>
+ </tableViewCell>
+ </prototypes>
+ <connections>
+ <outlet property="dataSource" destination="bdY-7c-pia" id="yhT-ag-TvP"/>
+ <outlet property="delegate" destination="bdY-7c-pia" id="usy-2O-hgr"/>
+ </connections>
+ </tableView>
+ <navigationItem key="navigationItem" id="3Tj-RI-j7Z">
+ <barButtonItem key="rightBarButtonItem" systemItem="refresh" id="B0E-4z-3fo" userLabel="Refresh">
+ <connections>
+ <action selector="refresh:" destination="bdY-7c-pia" id="3oQ-nv-MUd"/>
+ </connections>
+ </barButtonItem>
+ </navigationItem>
+ <simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
+ </tableViewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="pXd-g9-Hdc" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="-1036" y="-199"/>
+ </scene>
+ </scenes>
+ <simulatedMetricsContainer key="defaultSimulatedMetrics">
+ <simulatedStatusBarMetrics key="statusBar"/>
+ <simulatedOrientationMetrics key="orientation"/>
+ <simulatedScreenMetrics key="destination" type="retina4"/>
+ </simulatedMetricsContainer>
+</document>
diff --git a/playback/player/ios/GstPlay/OnlineMedia.plist b/playback/player/ios/GstPlay/OnlineMedia.plist
new file mode 100644
index 0000000..3a1c6c4
--- /dev/null
+++ b/playback/player/ios/GstPlay/OnlineMedia.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <array>
+ <!-- Big Buck Bunny -->
+ <string>http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_surround-fix.avi</string>
+ <string>http://mirrorblender.top-ix.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_h264.mov</string>
+ <string>http://mirrorblender.top-ix.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_stereo.ogg</string>
+ <string>http://mirrorblender.top-ix.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_stereo.avi</string>
+
+ <!--Sintel-->
+ <string>http://ftp.nluug.nl/ftp/graphics/blender/apricot/trailer/Sintel_Trailer1.480p.DivX_Plus_HD.mkv</string>
+ <string>http://ftp.nluug.nl/ftp/graphics/blender/apricot/trailer/sintel_trailer-480p.mp4</string>
+ <string>http://ftp.nluug.nl/ftp/graphics/blender/apricot/trailer/sintel_trailer-480p.ogv</string>
+ <string>http://mirrorblender.top-ix.org/movies/sintel-1024-surround.mp4</string>
+
+ <!--Tears of Steel-->
+ <string>http://blender-mirror.kino3d.org/mango/download.blender.org/demo/movies/ToS/tears_of_steel_720p.mkv</string>
+ <string>http://blender-mirror.kino3d.org/mango/download.blender.org/demo/movies/ToS/tears_of_steel_720p.mov</string>
+ <string>http://media.xiph.org/mango/tears_of_steel_1080p.webm</string>
+
+ <!--Radio stations-->
+ <string>http://radio.hbr1.com:19800/trance.ogg</string>
+ <string>http://radio.hbr1.com:19800/tronic.aac</string>
+
+ <!--Non-existing entries (to debug error reporting facilities)-->
+ <string>http://non-existing.org/Non_Existing_Server</string>
+ <string>http://docs.gstreamer.com/Non_Existing_File</string>
+ </array>
+</plist>
diff --git a/playback/player/ios/GstPlay/Ubuntu-R.ttf b/playback/player/ios/GstPlay/Ubuntu-R.ttf
new file mode 100644
index 0000000..45a038b
--- /dev/null
+++ b/playback/player/ios/GstPlay/Ubuntu-R.ttf
Binary files differ
diff --git a/playback/player/ios/GstPlay/VideoViewController.h b/playback/player/ios/GstPlay/VideoViewController.h
new file mode 100644
index 0000000..97ee6e7
--- /dev/null
+++ b/playback/player/ios/GstPlay/VideoViewController.h
@@ -0,0 +1,23 @@
+#import <UIKit/UIKit.h>
+
+@interface VideoViewController : UIViewController {
+ IBOutlet UIBarButtonItem *play_button;
+ IBOutlet UIBarButtonItem *pause_button;
+ IBOutlet UIView *video_view;
+ IBOutlet UIView *video_container_view;
+ IBOutlet NSLayoutConstraint *video_width_constraint;
+ IBOutlet NSLayoutConstraint *video_height_constraint;
+ IBOutlet UIToolbar *toolbar;
+ IBOutlet UITextField *time_label;
+ IBOutlet UISlider *time_slider;
+}
+
+@property (retain,nonatomic) NSString *uri;
+
+-(IBAction) play:(id)sender;
+-(IBAction) pause:(id)sender;
+-(IBAction) sliderValueChanged:(id)sender;
+-(IBAction) sliderTouchDown:(id)sender;
+-(IBAction) sliderTouchUp:(id)sender;
+
+@end
diff --git a/playback/player/ios/GstPlay/VideoViewController.m b/playback/player/ios/GstPlay/VideoViewController.m
new file mode 100644
index 0000000..079fcde
--- /dev/null
+++ b/playback/player/ios/GstPlay/VideoViewController.m
@@ -0,0 +1,205 @@
+#import "VideoViewController.h"
+#import <gst/player/player.h>
+#import <UIKit/UIKit.h>
+
+@interface VideoViewController () {
+ GstPlayer *player;
+ int media_width; /* Width of the clip */
+ int media_height; /* height ofthe clip */
+ Boolean dragging_slider; /* Whether the time slider is being dragged or not */
+ Boolean is_local_media; /* Whether this clip is stored locally or is being streamed */
+ Boolean is_playing_desired; /* Whether the user asked to go to PLAYING */
+}
+
+@end
+
+@implementation VideoViewController
+
+@synthesize uri;
+
+/*
+ * Private methods
+ */
+
+/* The text widget acts as an slave for the seek bar, so it reflects what the seek bar shows, whether
+ * it is an actual pipeline position or the position the user is currently dragging to. */
+- (void) updateTimeWidget
+{
+ NSInteger position = time_slider.value / 1000;
+ NSInteger duration = time_slider.maximumValue / 1000;
+ NSString *position_txt = @" -- ";
+ NSString *duration_txt = @" -- ";
+
+ if (duration > 0) {
+ NSUInteger hours = duration / (60 * 60);
+ NSUInteger minutes = (duration / 60) % 60;
+ NSUInteger seconds = duration % 60;
+
+ duration_txt = [NSString stringWithFormat:@"%02u:%02u:%02u", hours, minutes, seconds];
+ }
+ if (position > 0) {
+ NSUInteger hours = position / (60 * 60);
+ NSUInteger minutes = (position / 60) % 60;
+ NSUInteger seconds = position % 60;
+
+ position_txt = [NSString stringWithFormat:@"%02u:%02u:%02u", hours, minutes, seconds];
+ }
+
+ NSString *text = [NSString stringWithFormat:@"%@ / %@",
+ position_txt, duration_txt];
+
+ time_label.text = text;
+}
+
+/*
+ * Methods from UIViewController
+ */
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ /* As soon as the GStreamer backend knows the real values, these ones will be replaced */
+ media_width = 320;
+ media_height = 240;
+
+ player = gst_player_new (gst_player_video_overlay_video_renderer_new ((__bridge gpointer)(video_view)), NULL);
+ g_object_set (player, "uri", [uri UTF8String], NULL);
+
+ gst_debug_set_threshold_for_name("gst-player", GST_LEVEL_TRACE);
+
+ g_signal_connect (player, "position-updated", G_CALLBACK (position_updated), (__bridge gpointer) self);
+ g_signal_connect (player, "duration-changed", G_CALLBACK (duration_changed), (__bridge gpointer) self);
+ g_signal_connect (player, "video-dimensions-changed", G_CALLBACK (video_dimensions_changed), (__bridge gpointer) self);
+
+ is_local_media = [uri hasPrefix:@"file://"];
+ is_playing_desired = NO;
+}
+
+- (void)viewDidDisappear:(BOOL)animated
+{
+ if (player)
+ {
+ gst_object_unref (player);
+ }
+ [UIApplication sharedApplication].idleTimerDisabled = NO;
+}
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+ // Dispose of any resources that can be recreated.
+}
+
+/* Called when the Play button is pressed */
+-(IBAction) play:(id)sender
+{
+ gst_player_play (player);
+ is_playing_desired = YES;
+ [UIApplication sharedApplication].idleTimerDisabled = YES;
+}
+
+/* Called when the Pause button is pressed */
+-(IBAction) pause:(id)sender
+{
+ gst_player_pause(player);
+ is_playing_desired = NO;
+ [UIApplication sharedApplication].idleTimerDisabled = NO;
+}
+
+/* Called when the time slider position has changed, either because the user dragged it or
+ * we programmatically changed its position. dragging_slider tells us which one happened */
+- (IBAction)sliderValueChanged:(id)sender {
+ if (!dragging_slider) return;
+ // If this is a local file, allow scrub seeking, this is, seek as soon as the slider is moved.
+ if (is_local_media)
+ gst_player_seek (player, time_slider.value * 1000000);
+ [self updateTimeWidget];
+}
+
+/* Called when the user starts to drag the time slider */
+- (IBAction)sliderTouchDown:(id)sender {
+ gst_player_pause (player);
+ dragging_slider = YES;
+}
+
+/* Called when the user stops dragging the time slider */
+- (IBAction)sliderTouchUp:(id)sender {
+ dragging_slider = NO;
+ // If this is a remote file, scrub seeking is probably not going to work smoothly enough.
+ // Therefore, perform only the seek when the slider is released.
+ if (!is_local_media)
+ gst_player_seek (player, ((long)time_slider.value) * 1000000);
+ if (is_playing_desired)
+ gst_player_play (player);
+}
+
+/* Called when the size of the main view has changed, so we can
+ * resize the sub-views in ways not allowed by storyboarding. */
+- (void)viewDidLayoutSubviews
+{
+ CGFloat view_width = video_container_view.bounds.size.width;
+ CGFloat view_height = video_container_view.bounds.size.height;
+
+ CGFloat correct_height = view_width * media_height / media_width;
+ CGFloat correct_width = view_height * media_width / media_height;
+
+ if (correct_height < view_height) {
+ video_height_constraint.constant = correct_height;
+ video_width_constraint.constant = view_width;
+ } else {
+ video_width_constraint.constant = correct_width;
+ video_height_constraint.constant = view_height;
+ }
+
+ time_slider.frame = CGRectMake(time_slider.frame.origin.x, time_slider.frame.origin.y, toolbar.frame.size.width - time_slider.frame.origin.x - 8, time_slider.frame.size.height);
+}
+
+static void video_dimensions_changed (GstPlayer * unused, gint width, gint height, VideoViewController * self)
+{
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (width > 0 && height > 0) {
+ [self videoDimensionsChanged:width height:height];
+ }
+ });
+}
+
+-(void) videoDimensionsChanged:(NSInteger)width height:(NSInteger)height
+{
+ media_width = width;
+ media_height = height;
+ [self viewDidLayoutSubviews];
+ [video_view setNeedsLayout];
+ [video_view layoutIfNeeded];
+}
+
+static void position_updated (GstPlayer * unused, GstClockTime position, VideoViewController *self)
+{
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self positionUpdated:(int) (position / 1000000)];
+ });
+}
+
+-(void) positionUpdated:(NSInteger)position
+{
+ /* Ignore messages from the pipeline if the time sliders is being dragged */
+ if (dragging_slider) return;
+
+ time_slider.value = position;
+ [self updateTimeWidget];
+}
+
+static void duration_changed (GstPlayer * unused, GstClockTime duration, VideoViewController *self)
+{
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self durationChanged:(int) (duration / 1000000)];
+ });
+}
+
+-(void) durationChanged:(NSInteger)duration
+{
+ time_slider.maximumValue = duration;
+ [self updateTimeWidget];
+}
+
+@end
diff --git a/playback/player/ios/GstPlay/en.lproj/InfoPlist.strings b/playback/player/ios/GstPlay/en.lproj/InfoPlist.strings
new file mode 100644
index 0000000..477b28f
--- /dev/null
+++ b/playback/player/ios/GstPlay/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
diff --git a/playback/player/ios/GstPlay/fonts.conf b/playback/player/ios/GstPlay/fonts.conf
new file mode 100644
index 0000000..6b780ea
--- /dev/null
+++ b/playback/player/ios/GstPlay/fonts.conf
@@ -0,0 +1,126 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<!-- /etc/fonts/fonts.conf file to configure system font access -->
+<fontconfig>
+
+<!-- Font directory list -->
+
+ <dir prefix="xdg"></dir>
+
+<!-- Font cache directory list -->
+
+ <cachedir prefix="xdg"></cachedir>
+
+<!--
+ Accept deprecated 'mono' alias, replacing it with 'monospace'
+-->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>mono</string>
+ </test>
+ <edit name="family" mode="assign" binding="same">
+ <string>monospace</string>
+ </edit>
+ </match>
+
+<!--
+ Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
+-->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans serif</string>
+ </test>
+ <edit name="family" mode="assign" binding="same">
+ <string>sans-serif</string>
+ </edit>
+ </match>
+
+<!--
+ Accept deprecated 'sans' alias, replacing it with 'sans-serif'
+-->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans</string>
+ </test>
+ <edit name="family" mode="assign" binding="same">
+ <string>sans-serif</string>
+ </edit>
+ </match>
+
+ <config>
+<!--
+ These are the default Unicode chars that are expected to be blank
+ in fonts. All other blank chars are assumed to be broken and
+ won't appear in the resulting charsets
+ -->
+ <blank>
+ <int>0x0020</int> <!-- SPACE -->
+ <int>0x00A0</int> <!-- NO-BREAK SPACE -->
+ <int>0x00AD</int> <!-- SOFT HYPHEN -->
+ <int>0x034F</int> <!-- COMBINING GRAPHEME JOINER -->
+ <int>0x0600</int> <!-- ARABIC NUMBER SIGN -->
+ <int>0x0601</int> <!-- ARABIC SIGN SANAH -->
+ <int>0x0602</int> <!-- ARABIC FOOTNOTE MARKER -->
+ <int>0x0603</int> <!-- ARABIC SIGN SAFHA -->
+ <int>0x06DD</int> <!-- ARABIC END OF AYAH -->
+ <int>0x070F</int> <!-- SYRIAC ABBREVIATION MARK -->
+ <int>0x115F</int> <!-- HANGUL CHOSEONG FILLER -->
+ <int>0x1160</int> <!-- HANGUL JUNGSEONG FILLER -->
+ <int>0x1680</int> <!-- OGHAM SPACE MARK -->
+ <int>0x17B4</int> <!-- KHMER VOWEL INHERENT AQ -->
+ <int>0x17B5</int> <!-- KHMER VOWEL INHERENT AA -->
+ <int>0x180E</int> <!-- MONGOLIAN VOWEL SEPARATOR -->
+ <int>0x2000</int> <!-- EN QUAD -->
+ <int>0x2001</int> <!-- EM QUAD -->
+ <int>0x2002</int> <!-- EN SPACE -->
+ <int>0x2003</int> <!-- EM SPACE -->
+ <int>0x2004</int> <!-- THREE-PER-EM SPACE -->
+ <int>0x2005</int> <!-- FOUR-PER-EM SPACE -->
+ <int>0x2006</int> <!-- SIX-PER-EM SPACE -->
+ <int>0x2007</int> <!-- FIGURE SPACE -->
+ <int>0x2008</int> <!-- PUNCTUATION SPACE -->
+ <int>0x2009</int> <!-- THIN SPACE -->
+ <int>0x200A</int> <!-- HAIR SPACE -->
+ <int>0x200B</int> <!-- ZERO WIDTH SPACE -->
+ <int>0x200C</int> <!-- ZERO WIDTH NON-JOINER -->
+ <int>0x200D</int> <!-- ZERO WIDTH JOINER -->
+ <int>0x200E</int> <!-- LEFT-TO-RIGHT MARK -->
+ <int>0x200F</int> <!-- RIGHT-TO-LEFT MARK -->
+ <int>0x2028</int> <!-- LINE SEPARATOR -->
+ <int>0x2029</int> <!-- PARAGRAPH SEPARATOR -->
+ <int>0x202A</int> <!-- LEFT-TO-RIGHT EMBEDDING -->
+ <int>0x202B</int> <!-- RIGHT-TO-LEFT EMBEDDING -->
+ <int>0x202C</int> <!-- POP DIRECTIONAL FORMATTING -->
+ <int>0x202D</int> <!-- LEFT-TO-RIGHT OVERRIDE -->
+ <int>0x202E</int> <!-- RIGHT-TO-LEFT OVERRIDE -->
+ <int>0x202F</int> <!-- NARROW NO-BREAK SPACE -->
+ <int>0x205F</int> <!-- MEDIUM MATHEMATICAL SPACE -->
+ <int>0x2060</int> <!-- WORD JOINER -->
+ <int>0x2061</int> <!-- FUNCTION APPLICATION -->
+ <int>0x2062</int> <!-- INVISIBLE TIMES -->
+ <int>0x2063</int> <!-- INVISIBLE SEPARATOR -->
+ <int>0x206A</int> <!-- INHIBIT SYMMETRIC SWAPPING -->
+ <int>0x206B</int> <!-- ACTIVATE SYMMETRIC SWAPPING -->
+ <int>0x206C</int> <!-- INHIBIT ARABIC FORM SHAPING -->
+ <int>0x206D</int> <!-- ACTIVATE ARABIC FORM SHAPING -->
+ <int>0x206E</int> <!-- NATIONAL DIGIT SHAPES -->
+ <int>0x206F</int> <!-- NOMINAL DIGIT SHAPES -->
+ <int>0x2800</int> <!-- BRAILLE PATTERN BLANK -->
+ <int>0x3000</int> <!-- IDEOGRAPHIC SPACE -->
+ <int>0x3164</int> <!-- HANGUL FILLER -->
+ <int>0xFEFF</int> <!-- ZERO WIDTH NO-BREAK SPACE -->
+ <int>0xFFA0</int> <!-- HALFWIDTH HANGUL FILLER -->
+ <int>0xFFF9</int> <!-- INTERLINEAR ANNOTATION ANCHOR -->
+ <int>0xFFFA</int> <!-- INTERLINEAR ANNOTATION SEPARATOR -->
+ <int>0xFFFB</int> <!-- INTERLINEAR ANNOTATION TERMINATOR -->
+ </blank>
+<!--
+ Rescan configuration every 30 seconds when FcFontSetList is called
+ -->
+ <rescan>
+ <int>30</int>
+ </rescan>
+ </config>
+
+</fontconfig>
+
diff --git a/playback/player/ios/GstPlay/gst_ios_init.h b/playback/player/ios/GstPlay/gst_ios_init.h
new file mode 100644
index 0000000..870515b
--- /dev/null
+++ b/playback/player/ios/GstPlay/gst_ios_init.h
@@ -0,0 +1,39 @@
+#ifndef __GST_IOS_INIT_H__
+#define __GST_IOS_INIT_H__
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+#define GST_G_IO_MODULE_DECLARE(name) \
+extern void G_PASTE(g_io_module_, G_PASTE(name, _load_static)) (void)
+
+#define GST_G_IO_MODULE_LOAD(name) \
+G_PASTE(g_io_module_, G_PASTE(name, _load_static)) ()
+
+/* Uncomment each line to enable the plugin categories that your application needs.
+ * You can also enable individual plugins. See gst_ios_init.c to see their names
+ */
+
+//#define GST_IOS_PLUGINS_GES
+#define GST_IOS_PLUGINS_CORE
+//#define GST_IOS_PLUGINS_CAPTURE
+#define GST_IOS_PLUGINS_CODECS_RESTRICTED
+//#define GST_IOS_PLUGINS_ENCODING
+#define GST_IOS_PLUGINS_CODECS_GPL
+#define GST_IOS_PLUGINS_NET_RESTRICTED
+#define GST_IOS_PLUGINS_SYS
+#define GST_IOS_PLUGINS_VIS
+#define GST_IOS_PLUGINS_PLAYBACK
+#define GST_IOS_PLUGINS_EFFECTS
+#define GST_IOS_PLUGINS_CODECS
+#define GST_IOS_PLUGINS_NET
+
+
+#define GST_IOS_GIO_MODULE_GNUTLS
+
+void gst_ios_init ();
+
+G_END_DECLS
+
+#endif
diff --git a/playback/player/ios/GstPlay/gst_ios_init.m b/playback/player/ios/GstPlay/gst_ios_init.m
new file mode 100644
index 0000000..214b2e8
--- /dev/null
+++ b/playback/player/ios/GstPlay/gst_ios_init.m
@@ -0,0 +1,1054 @@
+#include "gst_ios_init.h"
+
+#if defined(GST_IOS_PLUGIN_NLE) || defined(GST_IOS_PLUGINS_GES)
+GST_PLUGIN_STATIC_DECLARE(nle);
+#endif
+#if defined(GST_IOS_PLUGIN_COREELEMENTS) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(coreelements);
+#endif
+#if defined(GST_IOS_PLUGIN_ADDER) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(adder);
+#endif
+#if defined(GST_IOS_PLUGIN_APP) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(app);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIOCONVERT) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(audioconvert);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIORATE) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(audiorate);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIORESAMPLE) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(audioresample);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIOTESTSRC) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(audiotestsrc);
+#endif
+#if defined(GST_IOS_PLUGIN_GIO) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(gio);
+#endif
+#if defined(GST_IOS_PLUGIN_PANGO) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(pango);
+#endif
+#if defined(GST_IOS_PLUGIN_TYPEFINDFUNCTIONS) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(typefindfunctions);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOCONVERT) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(videoconvert);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEORATE) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(videorate);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOSCALE) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(videoscale);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOTESTSRC) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(videotestsrc);
+#endif
+#if defined(GST_IOS_PLUGIN_VOLUME) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(volume);
+#endif
+#if defined(GST_IOS_PLUGIN_AUTODETECT) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(autodetect);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOFILTER) || defined(GST_IOS_PLUGINS_CORE)
+GST_PLUGIN_STATIC_DECLARE(videofilter);
+#endif
+#if defined(GST_IOS_PLUGIN_CAMERABIN) || defined(GST_IOS_PLUGINS_CAPTURE)
+GST_PLUGIN_STATIC_DECLARE(camerabin);
+#endif
+#if defined(GST_IOS_PLUGIN_ASFMUX) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(asfmux);
+#endif
+#if defined(GST_IOS_PLUGIN_DTSDEC) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(dtsdec);
+#endif
+#if defined(GST_IOS_PLUGIN_FAAD) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(faad);
+#endif
+#if defined(GST_IOS_PLUGIN_MPEGPSDEMUX) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(mpegpsdemux);
+#endif
+#if defined(GST_IOS_PLUGIN_MPEGPSMUX) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(mpegpsmux);
+#endif
+#if defined(GST_IOS_PLUGIN_MPEGTSDEMUX) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(mpegtsdemux);
+#endif
+#if defined(GST_IOS_PLUGIN_MPEGTSMUX) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(mpegtsmux);
+#endif
+#if defined(GST_IOS_PLUGIN_VOAACENC) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(voaacenc);
+#endif
+#if defined(GST_IOS_PLUGIN_A52DEC) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(a52dec);
+#endif
+#if defined(GST_IOS_PLUGIN_AMRNB) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(amrnb);
+#endif
+#if defined(GST_IOS_PLUGIN_AMRWBDEC) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(amrwbdec);
+#endif
+#if defined(GST_IOS_PLUGIN_ASF) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(asf);
+#endif
+#if defined(GST_IOS_PLUGIN_DVDSUB) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(dvdsub);
+#endif
+#if defined(GST_IOS_PLUGIN_DVDLPCMDEC) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(dvdlpcmdec);
+#endif
+#if defined(GST_IOS_PLUGIN_MAD) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(mad);
+#endif
+#if defined(GST_IOS_PLUGIN_MPEG2DEC) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(mpeg2dec);
+#endif
+#if defined(GST_IOS_PLUGIN_XINGMUX) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(xingmux);
+#endif
+#if defined(GST_IOS_PLUGIN_REALMEDIA) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(realmedia);
+#endif
+#if defined(GST_IOS_PLUGIN_X264) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(x264);
+#endif
+#if defined(GST_IOS_PLUGIN_LAME) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(lame);
+#endif
+#if defined(GST_IOS_PLUGIN_MPG123) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(mpg123);
+#endif
+#if defined(GST_IOS_PLUGIN_LIBAV) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(libav);
+#endif
+#if defined(GST_IOS_PLUGIN_ENCODING) || defined(GST_IOS_PLUGINS_ENCODING)
+GST_PLUGIN_STATIC_DECLARE(encoding);
+#endif
+#if defined(GST_IOS_PLUGIN_ASSRENDER) || defined(GST_IOS_PLUGINS_CODECS_GPL)
+GST_PLUGIN_STATIC_DECLARE(assrender);
+#endif
+#if defined(GST_IOS_PLUGIN_MMS) || defined(GST_IOS_PLUGINS_NET_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(mms);
+#endif
+#if defined(GST_IOS_PLUGIN_RTMP) || defined(GST_IOS_PLUGINS_NET_RESTRICTED)
+GST_PLUGIN_STATIC_DECLARE(rtmp);
+#endif
+#if defined(GST_IOS_PLUGIN_OSXAUDIO) || defined(GST_IOS_PLUGINS_SYS)
+GST_PLUGIN_STATIC_DECLARE(osxaudio);
+#endif
+#if defined(GST_IOS_PLUGIN_APPLEMEDIA) || defined(GST_IOS_PLUGINS_SYS)
+GST_PLUGIN_STATIC_DECLARE(applemedia);
+#endif
+#if defined(GST_IOS_PLUGIN_SHM) || defined(GST_IOS_PLUGINS_SYS)
+GST_PLUGIN_STATIC_DECLARE(shm);
+#endif
+#if defined(GST_IOS_PLUGIN_OPENGL) || defined(GST_IOS_PLUGINS_SYS)
+GST_PLUGIN_STATIC_DECLARE(opengl);
+#endif
+#if defined(GST_IOS_PLUGIN_LIBVISUAL) || defined(GST_IOS_PLUGINS_VIS)
+GST_PLUGIN_STATIC_DECLARE(libvisual);
+#endif
+#if defined(GST_IOS_PLUGIN_GOOM) || defined(GST_IOS_PLUGINS_VIS)
+GST_PLUGIN_STATIC_DECLARE(goom);
+#endif
+#if defined(GST_IOS_PLUGIN_GOOM2K1) || defined(GST_IOS_PLUGINS_VIS)
+GST_PLUGIN_STATIC_DECLARE(goom2k1);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIOVISUALIZERS) || defined(GST_IOS_PLUGINS_VIS)
+GST_PLUGIN_STATIC_DECLARE(audiovisualizers);
+#endif
+#if defined(GST_IOS_PLUGIN_PLAYBACK) || defined(GST_IOS_PLUGINS_PLAYBACK)
+GST_PLUGIN_STATIC_DECLARE(playback);
+#endif
+#if defined(GST_IOS_PLUGIN_ALPHA) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(alpha);
+#endif
+#if defined(GST_IOS_PLUGIN_ALPHACOLOR) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(alphacolor);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIOFX) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(audiofx);
+#endif
+#if defined(GST_IOS_PLUGIN_CAIRO) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(cairo);
+#endif
+#if defined(GST_IOS_PLUGIN_CUTTER) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(cutter);
+#endif
+#if defined(GST_IOS_PLUGIN_DEBUG) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(debug);
+#endif
+#if defined(GST_IOS_PLUGIN_DEINTERLACE) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(deinterlace);
+#endif
+#if defined(GST_IOS_PLUGIN_DTMF) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(dtmf);
+#endif
+#if defined(GST_IOS_PLUGIN_EFFECTV) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(effectv);
+#endif
+#if defined(GST_IOS_PLUGIN_EQUALIZER) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(equalizer);
+#endif
+#if defined(GST_IOS_PLUGIN_GDKPIXBUF) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(gdkpixbuf);
+#endif
+#if defined(GST_IOS_PLUGIN_IMAGEFREEZE) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(imagefreeze);
+#endif
+#if defined(GST_IOS_PLUGIN_INTERLEAVE) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(interleave);
+#endif
+#if defined(GST_IOS_PLUGIN_LEVEL) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(level);
+#endif
+#if defined(GST_IOS_PLUGIN_MULTIFILE) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(multifile);
+#endif
+#if defined(GST_IOS_PLUGIN_REPLAYGAIN) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(replaygain);
+#endif
+#if defined(GST_IOS_PLUGIN_SHAPEWIPE) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(shapewipe);
+#endif
+#if defined(GST_IOS_PLUGIN_SMPTE) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(smpte);
+#endif
+#if defined(GST_IOS_PLUGIN_SPECTRUM) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(spectrum);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOBOX) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(videobox);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOCROP) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(videocrop);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOMIXER) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(videomixer);
+#endif
+#if defined(GST_IOS_PLUGIN_ACCURIP) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(accurip);
+#endif
+#if defined(GST_IOS_PLUGIN_AIFF) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(aiff);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIOFXBAD) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(audiofxbad);
+#endif
+#if defined(GST_IOS_PLUGIN_AUTOCONVERT) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(autoconvert);
+#endif
+#if defined(GST_IOS_PLUGIN_BAYER) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(bayer);
+#endif
+#if defined(GST_IOS_PLUGIN_COLOREFFECTS) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(coloreffects);
+#endif
+#if defined(GST_IOS_PLUGIN_DEBUGUTILSBAD) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(debugutilsbad);
+#endif
+#if defined(GST_IOS_PLUGIN_FIELDANALYSIS) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(fieldanalysis);
+#endif
+#if defined(GST_IOS_PLUGIN_FREEVERB) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(freeverb);
+#endif
+#if defined(GST_IOS_PLUGIN_FREI0R) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(frei0r);
+#endif
+#if defined(GST_IOS_PLUGIN_GAUDIEFFECTS) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(gaudieffects);
+#endif
+#if defined(GST_IOS_PLUGIN_GEOMETRICTRANSFORM) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(geometrictransform);
+#endif
+#if defined(GST_IOS_PLUGIN_INTER) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(inter);
+#endif
+#if defined(GST_IOS_PLUGIN_INTERLACE) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(interlace);
+#endif
+#if defined(GST_IOS_PLUGIN_IVTC) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(ivtc);
+#endif
+#if defined(GST_IOS_PLUGIN_RAWPARSE) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(rawparse);
+#endif
+#if defined(GST_IOS_PLUGIN_REMOVESILENCE) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(removesilence);
+#endif
+#if defined(GST_IOS_PLUGIN_SEGMENTCLIP) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(segmentclip);
+#endif
+#if defined(GST_IOS_PLUGIN_SMOOTH) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(smooth);
+#endif
+#if defined(GST_IOS_PLUGIN_SPEED) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(speed);
+#endif
+#if defined(GST_IOS_PLUGIN_SOUNDTOUCH) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(soundtouch);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOFILTERSBAD) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(videofiltersbad);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIOMIXER) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(audiomixer);
+#endif
+#if defined(GST_IOS_PLUGIN_COMPOSITOR) || defined(GST_IOS_PLUGINS_EFFECTS)
+GST_PLUGIN_STATIC_DECLARE(compositor);
+#endif
+#if defined(GST_IOS_PLUGIN_SUBPARSE) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(subparse);
+#endif
+#if defined(GST_IOS_PLUGIN_OGG) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(ogg);
+#endif
+#if defined(GST_IOS_PLUGIN_THEORA) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(theora);
+#endif
+#if defined(GST_IOS_PLUGIN_VORBIS) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(vorbis);
+#endif
+#if defined(GST_IOS_PLUGIN_OPUS) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(opus);
+#endif
+#if defined(GST_IOS_PLUGIN_IVORBISDEC) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(ivorbisdec);
+#endif
+#if defined(GST_IOS_PLUGIN_ALAW) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(alaw);
+#endif
+#if defined(GST_IOS_PLUGIN_APETAG) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(apetag);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIOPARSERS) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(audioparsers);
+#endif
+#if defined(GST_IOS_PLUGIN_AUPARSE) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(auparse);
+#endif
+#if defined(GST_IOS_PLUGIN_AVI) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(avi);
+#endif
+#if defined(GST_IOS_PLUGIN_DV) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(dv);
+#endif
+#if defined(GST_IOS_PLUGIN_FLAC) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(flac);
+#endif
+#if defined(GST_IOS_PLUGIN_FLV) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(flv);
+#endif
+#if defined(GST_IOS_PLUGIN_FLXDEC) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(flxdec);
+#endif
+#if defined(GST_IOS_PLUGIN_ICYDEMUX) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(icydemux);
+#endif
+#if defined(GST_IOS_PLUGIN_ID3DEMUX) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(id3demux);
+#endif
+#if defined(GST_IOS_PLUGIN_ISOMP4) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(isomp4);
+#endif
+#if defined(GST_IOS_PLUGIN_JPEG) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(jpeg);
+#endif
+#if defined(GST_IOS_PLUGIN_MATROSKA) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(matroska);
+#endif
+#if defined(GST_IOS_PLUGIN_MULAW) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(mulaw);
+#endif
+#if defined(GST_IOS_PLUGIN_MULTIPART) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(multipart);
+#endif
+#if defined(GST_IOS_PLUGIN_PNG) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(png);
+#endif
+#if defined(GST_IOS_PLUGIN_SPEEX) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(speex);
+#endif
+#if defined(GST_IOS_PLUGIN_TAGLIB) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(taglib);
+#endif
+#if defined(GST_IOS_PLUGIN_VPX) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(vpx);
+#endif
+#if defined(GST_IOS_PLUGIN_WAVENC) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(wavenc);
+#endif
+#if defined(GST_IOS_PLUGIN_WAVPACK) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(wavpack);
+#endif
+#if defined(GST_IOS_PLUGIN_WAVPARSE) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(wavparse);
+#endif
+#if defined(GST_IOS_PLUGIN_Y4MENC) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(y4menc);
+#endif
+#if defined(GST_IOS_PLUGIN_ADPCMDEC) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(adpcmdec);
+#endif
+#if defined(GST_IOS_PLUGIN_ADPCMENC) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(adpcmenc);
+#endif
+#if defined(GST_IOS_PLUGIN_DASHDEMUX) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(dashdemux);
+#endif
+#if defined(GST_IOS_PLUGIN_DVBSUBOVERLAY) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(dvbsuboverlay);
+#endif
+#if defined(GST_IOS_PLUGIN_DVDSPU) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(dvdspu);
+#endif
+#if defined(GST_IOS_PLUGIN_HLS) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(hls);
+#endif
+#if defined(GST_IOS_PLUGIN_ID3TAG) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(id3tag);
+#endif
+#if defined(GST_IOS_PLUGIN_KATE) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(kate);
+#endif
+#if defined(GST_IOS_PLUGIN_MIDI) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(midi);
+#endif
+#if defined(GST_IOS_PLUGIN_MXF) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(mxf);
+#endif
+#if defined(GST_IOS_PLUGIN_OPENH264) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(openh264);
+#endif
+#if defined(GST_IOS_PLUGIN_OPUSPARSE) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(opusparse);
+#endif
+#if defined(GST_IOS_PLUGIN_PCAPPARSE) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(pcapparse);
+#endif
+#if defined(GST_IOS_PLUGIN_PNM) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(pnm);
+#endif
+#if defined(GST_IOS_PLUGIN_RFBSRC) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(rfbsrc);
+#endif
+#if defined(GST_IOS_PLUGIN_SCHRO) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(schro);
+#endif
+#if defined(GST_IOS_PLUGIN_GSTSIREN) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(gstsiren);
+#endif
+#if defined(GST_IOS_PLUGIN_SMOOTHSTREAMING) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(smoothstreaming);
+#endif
+#if defined(GST_IOS_PLUGIN_SUBENC) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(subenc);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOPARSERSBAD) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(videoparsersbad);
+#endif
+#if defined(GST_IOS_PLUGIN_Y4MDEC) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(y4mdec);
+#endif
+#if defined(GST_IOS_PLUGIN_JPEGFORMAT) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(jpegformat);
+#endif
+#if defined(GST_IOS_PLUGIN_GDP) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(gdp);
+#endif
+#if defined(GST_IOS_PLUGIN_RSVG) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(rsvg);
+#endif
+#if defined(GST_IOS_PLUGIN_OPENJPEG) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(openjpeg);
+#endif
+#if defined(GST_IOS_PLUGIN_SPANDSP) || defined(GST_IOS_PLUGINS_CODECS)
+GST_PLUGIN_STATIC_DECLARE(spandsp);
+#endif
+#if defined(GST_IOS_PLUGIN_TCP) || defined(GST_IOS_PLUGINS_NET)
+GST_PLUGIN_STATIC_DECLARE(tcp);
+#endif
+#if defined(GST_IOS_PLUGIN_RTSP) || defined(GST_IOS_PLUGINS_NET)
+GST_PLUGIN_STATIC_DECLARE(rtsp);
+#endif
+#if defined(GST_IOS_PLUGIN_RTP) || defined(GST_IOS_PLUGINS_NET)
+GST_PLUGIN_STATIC_DECLARE(rtp);
+#endif
+#if defined(GST_IOS_PLUGIN_RTPMANAGER) || defined(GST_IOS_PLUGINS_NET)
+GST_PLUGIN_STATIC_DECLARE(rtpmanager);
+#endif
+#if defined(GST_IOS_PLUGIN_SOUP) || defined(GST_IOS_PLUGINS_NET)
+GST_PLUGIN_STATIC_DECLARE(soup);
+#endif
+#if defined(GST_IOS_PLUGIN_UDP) || defined(GST_IOS_PLUGINS_NET)
+GST_PLUGIN_STATIC_DECLARE(udp);
+#endif
+#if defined(GST_IOS_PLUGIN_DATAURISRC) || defined(GST_IOS_PLUGINS_NET)
+GST_PLUGIN_STATIC_DECLARE(dataurisrc);
+#endif
+#if defined(GST_IOS_PLUGIN_SDP) || defined(GST_IOS_PLUGINS_NET)
+GST_PLUGIN_STATIC_DECLARE(sdp);
+#endif
+#if defined(GST_IOS_PLUGIN_SRTP) || defined(GST_IOS_PLUGINS_NET)
+GST_PLUGIN_STATIC_DECLARE(srtp);
+#endif
+#if defined(GST_IOS_PLUGIN_RTSPCLIENTSINK) || defined(GST_IOS_PLUGINS_NET)
+GST_PLUGIN_STATIC_DECLARE(rtspclientsink);
+#endif
+
+#if defined(GST_IOS_GIO_MODULE_GNUTLS)
+ #include <gio/gio.h>
+ GST_G_IO_MODULE_DECLARE(gnutls);
+#endif
+
+void
+gst_ios_init (void)
+{
+ GstPluginFeature *plugin;
+ GstRegistry *reg;
+ NSString *resources = [[NSBundle mainBundle] resourcePath];
+ NSString *tmp = NSTemporaryDirectory();
+ NSString *cache = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"];
+ NSString *docs = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
+
+ const gchar *resources_dir = [resources UTF8String];
+ const gchar *tmp_dir = [tmp UTF8String];
+ const gchar *cache_dir = [cache UTF8String];
+ const gchar *docs_dir = [docs UTF8String];
+ gchar *ca_certificates;
+
+ g_setenv ("TMP", tmp_dir, TRUE);
+ g_setenv ("TEMP", tmp_dir, TRUE);
+ g_setenv ("TMPDIR", tmp_dir, TRUE);
+ g_setenv ("XDG_RUNTIME_DIR", resources_dir, TRUE);
+ g_setenv ("XDG_CACHE_HOME", cache_dir, TRUE);
+
+ g_setenv ("HOME", docs_dir, TRUE);
+ g_setenv ("XDG_DATA_DIRS", resources_dir, TRUE);
+ g_setenv ("XDG_CONFIG_DIRS", resources_dir, TRUE);
+ g_setenv ("XDG_CONFIG_HOME", cache_dir, TRUE);
+ g_setenv ("XDG_DATA_HOME", resources_dir, TRUE);
+ g_setenv ("FONTCONFIG_PATH", resources_dir, TRUE);
+
+ ca_certificates = g_build_filename (resources_dir, "ssl", "certs", "ca-certifcates.crt", NULL);
+ g_setenv ("CA_CERTIFICATES", ca_certificates, TRUE);
+ g_free (ca_certificates);
+
+ gst_init (NULL, NULL);
+
+ #if defined(GST_IOS_PLUGIN_NLE) || defined(GST_IOS_PLUGINS_GES)
+ GST_PLUGIN_STATIC_REGISTER(nle);
+#endif
+#if defined(GST_IOS_PLUGIN_COREELEMENTS) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(coreelements);
+#endif
+#if defined(GST_IOS_PLUGIN_ADDER) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(adder);
+#endif
+#if defined(GST_IOS_PLUGIN_APP) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(app);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIOCONVERT) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(audioconvert);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIORATE) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(audiorate);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIORESAMPLE) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(audioresample);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIOTESTSRC) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(audiotestsrc);
+#endif
+#if defined(GST_IOS_PLUGIN_GIO) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(gio);
+#endif
+#if defined(GST_IOS_PLUGIN_PANGO) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(pango);
+#endif
+#if defined(GST_IOS_PLUGIN_TYPEFINDFUNCTIONS) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(typefindfunctions);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOCONVERT) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(videoconvert);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEORATE) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(videorate);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOSCALE) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(videoscale);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOTESTSRC) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(videotestsrc);
+#endif
+#if defined(GST_IOS_PLUGIN_VOLUME) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(volume);
+#endif
+#if defined(GST_IOS_PLUGIN_AUTODETECT) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(autodetect);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOFILTER) || defined(GST_IOS_PLUGINS_CORE)
+ GST_PLUGIN_STATIC_REGISTER(videofilter);
+#endif
+#if defined(GST_IOS_PLUGIN_CAMERABIN) || defined(GST_IOS_PLUGINS_CAPTURE)
+ GST_PLUGIN_STATIC_REGISTER(camerabin);
+#endif
+#if defined(GST_IOS_PLUGIN_ASFMUX) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(asfmux);
+#endif
+#if defined(GST_IOS_PLUGIN_DTSDEC) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(dtsdec);
+#endif
+#if defined(GST_IOS_PLUGIN_FAAD) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(faad);
+#endif
+#if defined(GST_IOS_PLUGIN_MPEGPSDEMUX) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(mpegpsdemux);
+#endif
+#if defined(GST_IOS_PLUGIN_MPEGPSMUX) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(mpegpsmux);
+#endif
+#if defined(GST_IOS_PLUGIN_MPEGTSDEMUX) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(mpegtsdemux);
+#endif
+#if defined(GST_IOS_PLUGIN_MPEGTSMUX) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(mpegtsmux);
+#endif
+#if defined(GST_IOS_PLUGIN_VOAACENC) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(voaacenc);
+#endif
+#if defined(GST_IOS_PLUGIN_A52DEC) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(a52dec);
+#endif
+#if defined(GST_IOS_PLUGIN_AMRNB) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(amrnb);
+#endif
+#if defined(GST_IOS_PLUGIN_AMRWBDEC) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(amrwbdec);
+#endif
+#if defined(GST_IOS_PLUGIN_ASF) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(asf);
+#endif
+#if defined(GST_IOS_PLUGIN_DVDSUB) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(dvdsub);
+#endif
+#if defined(GST_IOS_PLUGIN_DVDLPCMDEC) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(dvdlpcmdec);
+#endif
+#if defined(GST_IOS_PLUGIN_MAD) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(mad);
+#endif
+#if defined(GST_IOS_PLUGIN_MPEG2DEC) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(mpeg2dec);
+#endif
+#if defined(GST_IOS_PLUGIN_XINGMUX) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(xingmux);
+#endif
+#if defined(GST_IOS_PLUGIN_REALMEDIA) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(realmedia);
+#endif
+#if defined(GST_IOS_PLUGIN_X264) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(x264);
+#endif
+#if defined(GST_IOS_PLUGIN_LAME) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(lame);
+#endif
+#if defined(GST_IOS_PLUGIN_MPG123) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(mpg123);
+#endif
+#if defined(GST_IOS_PLUGIN_LIBAV) || defined(GST_IOS_PLUGINS_CODECS_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(libav);
+#endif
+#if defined(GST_IOS_PLUGIN_ENCODING) || defined(GST_IOS_PLUGINS_ENCODING)
+ GST_PLUGIN_STATIC_REGISTER(encoding);
+#endif
+#if defined(GST_IOS_PLUGIN_ASSRENDER) || defined(GST_IOS_PLUGINS_CODECS_GPL)
+ GST_PLUGIN_STATIC_REGISTER(assrender);
+#endif
+#if defined(GST_IOS_PLUGIN_MMS) || defined(GST_IOS_PLUGINS_NET_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(mms);
+#endif
+#if defined(GST_IOS_PLUGIN_RTMP) || defined(GST_IOS_PLUGINS_NET_RESTRICTED)
+ GST_PLUGIN_STATIC_REGISTER(rtmp);
+#endif
+#if defined(GST_IOS_PLUGIN_OSXAUDIO) || defined(GST_IOS_PLUGINS_SYS)
+ GST_PLUGIN_STATIC_REGISTER(osxaudio);
+#endif
+#if defined(GST_IOS_PLUGIN_APPLEMEDIA) || defined(GST_IOS_PLUGINS_SYS)
+ GST_PLUGIN_STATIC_REGISTER(applemedia);
+#endif
+#if defined(GST_IOS_PLUGIN_SHM) || defined(GST_IOS_PLUGINS_SYS)
+ GST_PLUGIN_STATIC_REGISTER(shm);
+#endif
+#if defined(GST_IOS_PLUGIN_OPENGL) || defined(GST_IOS_PLUGINS_SYS)
+ GST_PLUGIN_STATIC_REGISTER(opengl);
+#endif
+#if defined(GST_IOS_PLUGIN_LIBVISUAL) || defined(GST_IOS_PLUGINS_VIS)
+ GST_PLUGIN_STATIC_REGISTER(libvisual);
+#endif
+#if defined(GST_IOS_PLUGIN_GOOM) || defined(GST_IOS_PLUGINS_VIS)
+ GST_PLUGIN_STATIC_REGISTER(goom);
+#endif
+#if defined(GST_IOS_PLUGIN_GOOM2K1) || defined(GST_IOS_PLUGINS_VIS)
+ GST_PLUGIN_STATIC_REGISTER(goom2k1);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIOVISUALIZERS) || defined(GST_IOS_PLUGINS_VIS)
+ GST_PLUGIN_STATIC_REGISTER(audiovisualizers);
+#endif
+#if defined(GST_IOS_PLUGIN_PLAYBACK) || defined(GST_IOS_PLUGINS_PLAYBACK)
+ GST_PLUGIN_STATIC_REGISTER(playback);
+#endif
+#if defined(GST_IOS_PLUGIN_ALPHA) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(alpha);
+#endif
+#if defined(GST_IOS_PLUGIN_ALPHACOLOR) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(alphacolor);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIOFX) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(audiofx);
+#endif
+#if defined(GST_IOS_PLUGIN_CAIRO) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(cairo);
+#endif
+#if defined(GST_IOS_PLUGIN_CUTTER) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(cutter);
+#endif
+#if defined(GST_IOS_PLUGIN_DEBUG) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(debug);
+#endif
+#if defined(GST_IOS_PLUGIN_DEINTERLACE) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(deinterlace);
+#endif
+#if defined(GST_IOS_PLUGIN_DTMF) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(dtmf);
+#endif
+#if defined(GST_IOS_PLUGIN_EFFECTV) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(effectv);
+#endif
+#if defined(GST_IOS_PLUGIN_EQUALIZER) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(equalizer);
+#endif
+#if defined(GST_IOS_PLUGIN_GDKPIXBUF) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(gdkpixbuf);
+#endif
+#if defined(GST_IOS_PLUGIN_IMAGEFREEZE) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(imagefreeze);
+#endif
+#if defined(GST_IOS_PLUGIN_INTERLEAVE) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(interleave);
+#endif
+#if defined(GST_IOS_PLUGIN_LEVEL) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(level);
+#endif
+#if defined(GST_IOS_PLUGIN_MULTIFILE) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(multifile);
+#endif
+#if defined(GST_IOS_PLUGIN_REPLAYGAIN) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(replaygain);
+#endif
+#if defined(GST_IOS_PLUGIN_SHAPEWIPE) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(shapewipe);
+#endif
+#if defined(GST_IOS_PLUGIN_SMPTE) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(smpte);
+#endif
+#if defined(GST_IOS_PLUGIN_SPECTRUM) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(spectrum);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOBOX) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(videobox);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOCROP) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(videocrop);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOMIXER) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(videomixer);
+#endif
+#if defined(GST_IOS_PLUGIN_ACCURIP) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(accurip);
+#endif
+#if defined(GST_IOS_PLUGIN_AIFF) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(aiff);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIOFXBAD) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(audiofxbad);
+#endif
+#if defined(GST_IOS_PLUGIN_AUTOCONVERT) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(autoconvert);
+#endif
+#if defined(GST_IOS_PLUGIN_BAYER) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(bayer);
+#endif
+#if defined(GST_IOS_PLUGIN_COLOREFFECTS) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(coloreffects);
+#endif
+#if defined(GST_IOS_PLUGIN_DEBUGUTILSBAD) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(debugutilsbad);
+#endif
+#if defined(GST_IOS_PLUGIN_FIELDANALYSIS) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(fieldanalysis);
+#endif
+#if defined(GST_IOS_PLUGIN_FREEVERB) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(freeverb);
+#endif
+#if defined(GST_IOS_PLUGIN_FREI0R) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(frei0r);
+#endif
+#if defined(GST_IOS_PLUGIN_GAUDIEFFECTS) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(gaudieffects);
+#endif
+#if defined(GST_IOS_PLUGIN_GEOMETRICTRANSFORM) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(geometrictransform);
+#endif
+#if defined(GST_IOS_PLUGIN_INTER) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(inter);
+#endif
+#if defined(GST_IOS_PLUGIN_INTERLACE) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(interlace);
+#endif
+#if defined(GST_IOS_PLUGIN_IVTC) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(ivtc);
+#endif
+#if defined(GST_IOS_PLUGIN_RAWPARSE) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(rawparse);
+#endif
+#if defined(GST_IOS_PLUGIN_REMOVESILENCE) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(removesilence);
+#endif
+#if defined(GST_IOS_PLUGIN_SEGMENTCLIP) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(segmentclip);
+#endif
+#if defined(GST_IOS_PLUGIN_SMOOTH) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(smooth);
+#endif
+#if defined(GST_IOS_PLUGIN_SPEED) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(speed);
+#endif
+#if defined(GST_IOS_PLUGIN_SOUNDTOUCH) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(soundtouch);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOFILTERSBAD) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(videofiltersbad);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIOMIXER) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(audiomixer);
+#endif
+#if defined(GST_IOS_PLUGIN_COMPOSITOR) || defined(GST_IOS_PLUGINS_EFFECTS)
+ GST_PLUGIN_STATIC_REGISTER(compositor);
+#endif
+#if defined(GST_IOS_PLUGIN_SUBPARSE) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(subparse);
+#endif
+#if defined(GST_IOS_PLUGIN_OGG) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(ogg);
+#endif
+#if defined(GST_IOS_PLUGIN_THEORA) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(theora);
+#endif
+#if defined(GST_IOS_PLUGIN_VORBIS) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(vorbis);
+#endif
+#if defined(GST_IOS_PLUGIN_OPUS) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(opus);
+#endif
+#if defined(GST_IOS_PLUGIN_IVORBISDEC) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(ivorbisdec);
+#endif
+#if defined(GST_IOS_PLUGIN_ALAW) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(alaw);
+#endif
+#if defined(GST_IOS_PLUGIN_APETAG) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(apetag);
+#endif
+#if defined(GST_IOS_PLUGIN_AUDIOPARSERS) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(audioparsers);
+#endif
+#if defined(GST_IOS_PLUGIN_AUPARSE) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(auparse);
+#endif
+#if defined(GST_IOS_PLUGIN_AVI) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(avi);
+#endif
+#if defined(GST_IOS_PLUGIN_DV) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(dv);
+#endif
+#if defined(GST_IOS_PLUGIN_FLAC) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(flac);
+#endif
+#if defined(GST_IOS_PLUGIN_FLV) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(flv);
+#endif
+#if defined(GST_IOS_PLUGIN_FLXDEC) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(flxdec);
+#endif
+#if defined(GST_IOS_PLUGIN_ICYDEMUX) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(icydemux);
+#endif
+#if defined(GST_IOS_PLUGIN_ID3DEMUX) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(id3demux);
+#endif
+#if defined(GST_IOS_PLUGIN_ISOMP4) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(isomp4);
+#endif
+#if defined(GST_IOS_PLUGIN_JPEG) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(jpeg);
+#endif
+#if defined(GST_IOS_PLUGIN_MATROSKA) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(matroska);
+#endif
+#if defined(GST_IOS_PLUGIN_MULAW) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(mulaw);
+#endif
+#if defined(GST_IOS_PLUGIN_MULTIPART) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(multipart);
+#endif
+#if defined(GST_IOS_PLUGIN_PNG) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(png);
+#endif
+#if defined(GST_IOS_PLUGIN_SPEEX) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(speex);
+#endif
+#if defined(GST_IOS_PLUGIN_TAGLIB) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(taglib);
+#endif
+#if defined(GST_IOS_PLUGIN_VPX) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(vpx);
+#endif
+#if defined(GST_IOS_PLUGIN_WAVENC) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(wavenc);
+#endif
+#if defined(GST_IOS_PLUGIN_WAVPACK) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(wavpack);
+#endif
+#if defined(GST_IOS_PLUGIN_WAVPARSE) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(wavparse);
+#endif
+#if defined(GST_IOS_PLUGIN_Y4MENC) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(y4menc);
+#endif
+#if defined(GST_IOS_PLUGIN_ADPCMDEC) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(adpcmdec);
+#endif
+#if defined(GST_IOS_PLUGIN_ADPCMENC) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(adpcmenc);
+#endif
+#if defined(GST_IOS_PLUGIN_DASHDEMUX) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(dashdemux);
+#endif
+#if defined(GST_IOS_PLUGIN_DVBSUBOVERLAY) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(dvbsuboverlay);
+#endif
+#if defined(GST_IOS_PLUGIN_DVDSPU) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(dvdspu);
+#endif
+#if defined(GST_IOS_PLUGIN_HLS) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(hls);
+#endif
+#if defined(GST_IOS_PLUGIN_ID3TAG) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(id3tag);
+#endif
+#if defined(GST_IOS_PLUGIN_KATE) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(kate);
+#endif
+#if defined(GST_IOS_PLUGIN_MIDI) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(midi);
+#endif
+#if defined(GST_IOS_PLUGIN_MXF) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(mxf);
+#endif
+#if defined(GST_IOS_PLUGIN_OPENH264) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(openh264);
+#endif
+#if defined(GST_IOS_PLUGIN_OPUSPARSE) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(opusparse);
+#endif
+#if defined(GST_IOS_PLUGIN_PCAPPARSE) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(pcapparse);
+#endif
+#if defined(GST_IOS_PLUGIN_PNM) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(pnm);
+#endif
+#if defined(GST_IOS_PLUGIN_RFBSRC) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(rfbsrc);
+#endif
+#if defined(GST_IOS_PLUGIN_SCHRO) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(schro);
+#endif
+#if defined(GST_IOS_PLUGIN_GSTSIREN) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(gstsiren);
+#endif
+#if defined(GST_IOS_PLUGIN_SMOOTHSTREAMING) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(smoothstreaming);
+#endif
+#if defined(GST_IOS_PLUGIN_SUBENC) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(subenc);
+#endif
+#if defined(GST_IOS_PLUGIN_VIDEOPARSERSBAD) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(videoparsersbad);
+#endif
+#if defined(GST_IOS_PLUGIN_Y4MDEC) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(y4mdec);
+#endif
+#if defined(GST_IOS_PLUGIN_JPEGFORMAT) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(jpegformat);
+#endif
+#if defined(GST_IOS_PLUGIN_GDP) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(gdp);
+#endif
+#if defined(GST_IOS_PLUGIN_RSVG) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(rsvg);
+#endif
+#if defined(GST_IOS_PLUGIN_OPENJPEG) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(openjpeg);
+#endif
+#if defined(GST_IOS_PLUGIN_SPANDSP) || defined(GST_IOS_PLUGINS_CODECS)
+ GST_PLUGIN_STATIC_REGISTER(spandsp);
+#endif
+#if defined(GST_IOS_PLUGIN_TCP) || defined(GST_IOS_PLUGINS_NET)
+ GST_PLUGIN_STATIC_REGISTER(tcp);
+#endif
+#if defined(GST_IOS_PLUGIN_RTSP) || defined(GST_IOS_PLUGINS_NET)
+ GST_PLUGIN_STATIC_REGISTER(rtsp);
+#endif
+#if defined(GST_IOS_PLUGIN_RTP) || defined(GST_IOS_PLUGINS_NET)
+ GST_PLUGIN_STATIC_REGISTER(rtp);
+#endif
+#if defined(GST_IOS_PLUGIN_RTPMANAGER) || defined(GST_IOS_PLUGINS_NET)
+ GST_PLUGIN_STATIC_REGISTER(rtpmanager);
+#endif
+#if defined(GST_IOS_PLUGIN_SOUP) || defined(GST_IOS_PLUGINS_NET)
+ GST_PLUGIN_STATIC_REGISTER(soup);
+#endif
+#if defined(GST_IOS_PLUGIN_UDP) || defined(GST_IOS_PLUGINS_NET)
+ GST_PLUGIN_STATIC_REGISTER(udp);
+#endif
+#if defined(GST_IOS_PLUGIN_DATAURISRC) || defined(GST_IOS_PLUGINS_NET)
+ GST_PLUGIN_STATIC_REGISTER(dataurisrc);
+#endif
+#if defined(GST_IOS_PLUGIN_SDP) || defined(GST_IOS_PLUGINS_NET)
+ GST_PLUGIN_STATIC_REGISTER(sdp);
+#endif
+#if defined(GST_IOS_PLUGIN_SRTP) || defined(GST_IOS_PLUGINS_NET)
+ GST_PLUGIN_STATIC_REGISTER(srtp);
+#endif
+#if defined(GST_IOS_PLUGIN_RTSPCLIENTSINK) || defined(GST_IOS_PLUGINS_NET)
+ GST_PLUGIN_STATIC_REGISTER(rtspclientsink);
+#endif
+
+#if defined(GST_IOS_GIO_MODULE_GNUTLS)
+ GST_G_IO_MODULE_LOAD(gnutls);
+#endif
+
+ /* Lower the ranks of filesrc and giosrc so iosavassetsrc is
+ * tried first in gst_element_make_from_uri() for file:// */
+ reg = gst_registry_get();
+ plugin = gst_registry_lookup_feature(reg, "filesrc");
+ if (plugin)
+ gst_plugin_feature_set_rank(plugin, GST_RANK_SECONDARY);
+ plugin = gst_registry_lookup_feature(reg, "giosrc");
+ if (plugin)
+ gst_plugin_feature_set_rank(plugin, GST_RANK_SECONDARY-1);
+}
diff --git a/playback/player/ios/GstPlay/main.m b/playback/player/ios/GstPlay/main.m
new file mode 100644
index 0000000..6cf4e0f
--- /dev/null
+++ b/playback/player/ios/GstPlay/main.m
@@ -0,0 +1,12 @@
+#import <UIKit/UIKit.h>
+
+#import "AppDelegate.h"
+#include "gst_ios_init.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ gst_ios_init();
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
diff --git a/playback/player/ios/Makefile.am b/playback/player/ios/Makefile.am
new file mode 100644
index 0000000..c6da505
--- /dev/null
+++ b/playback/player/ios/Makefile.am
@@ -0,0 +1,22 @@
+EXTRA_DIST = \
+ GstPlay/AppDelegate.h \
+ GstPlay/AppDelegate.m \
+ GstPlay/EaglUIVIew.h \
+ GstPlay/EaglUIVIew.m \
+ GstPlay/en.lproj/InfoPlist.strings \
+ GstPlay/fonts.conf \
+ GstPlay/gst_ios_init.h \
+ GstPlay/gst_ios_init.m \
+ GstPlay/GstPlay-Info.plist \
+ GstPlay/GstPlay-Prefix.pch \
+ GstPlay/LibraryViewController.h \
+ GstPlay/LibraryViewController.m \
+ GstPlay/main.m \
+ GstPlay/MainStoryboard_iPad.storyboard \
+ GstPlay/MainStoryboard_iPhone.storyboard \
+ GstPlay/Ubuntu-R.ttf \
+ GstPlay/VideoViewController.h \
+ GstPlay/VideoViewController.m \
+ GstPlay.xcodeproj/project.xcworkspace/contents.xcworkspacedata \
+ GstPlay.xcodeproj/project.pbxproj
+
diff --git a/playback/player/qt/deployment.pri b/playback/player/qt/deployment.pri
new file mode 100644
index 0000000..5441b63
--- /dev/null
+++ b/playback/player/qt/deployment.pri
@@ -0,0 +1,27 @@
+android-no-sdk {
+ target.path = /data/user/qt
+ export(target.path)
+ INSTALLS += target
+} else:android {
+ x86 {
+ target.path = /libs/x86
+ } else: armeabi-v7a {
+ target.path = /libs/armeabi-v7a
+ } else {
+ target.path = /libs/armeabi
+ }
+ export(target.path)
+ INSTALLS += target
+} else:unix {
+ isEmpty(target.path) {
+ qnx {
+ target.path = /tmp/$${TARGET}/bin
+ } else {
+ target.path = /opt/$${TARGET}/bin
+ }
+ export(target.path)
+ }
+ INSTALLS += target
+}
+
+export(INSTALLS)
diff --git a/playback/player/qt/fontawesome-webfont.ttf b/playback/player/qt/fontawesome-webfont.ttf
new file mode 100644
index 0000000..ed9372f
--- /dev/null
+++ b/playback/player/qt/fontawesome-webfont.ttf
Binary files differ
diff --git a/playback/player/qt/fontawesome-webfont.ttf.txt b/playback/player/qt/fontawesome-webfont.ttf.txt
new file mode 100644
index 0000000..946b3cb
--- /dev/null
+++ b/playback/player/qt/fontawesome-webfont.ttf.txt
@@ -0,0 +1,10 @@
+
+Font Awesome
+
+URL: http://fontawesome.io
+
+Font License
+
+License: SIL OFL 1.1
+URL: http://scripts.sil.org/OFL
+
diff --git a/playback/player/qt/fontawesome.js b/playback/player/qt/fontawesome.js
new file mode 100644
index 0000000..8d135e1
--- /dev/null
+++ b/playback/player/qt/fontawesome.js
@@ -0,0 +1,214 @@
+var Icon = {
+ Glass : "\uf000",
+ Music : "\uf001",
+ Search : "\uf002",
+ Envelope : "\uf003",
+ Heart : "\uf004",
+ Star : "\uf005",
+ StarEmpty : "\uf006",
+ User : "\uf007",
+ Film : "\uf008",
+ ThLarge : "\uf009",
+ Th : "\uf00a",
+ ThList : "\uf00b",
+ Ok : "\uf00c",
+ Remove : "\uf00d",
+ ZoomIn : "\uf00e",
+ ZoomOut : "\uf010",
+ Off : "\uf011",
+ Signal : "\uf012",
+ Cog : "\uf013",
+ Trash : "\uf014",
+ Home : "\uf015",
+ File : "\uf016",
+ Time : "\uf017",
+ Road : "\uf018",
+ DownloadAlt : "\uf019",
+ Download : "\uf01a",
+ Upload : "\uf01b",
+ Inbox : "\uf01c",
+ PlayCircle : "\uf01d",
+ Repeat : "\uf01e",
+ Refresh : "\uf021",
+ ListAlt : "\uf022",
+ Lock : "\uf023",
+ Flag : "\uf024",
+ Headphones : "\uf025",
+ VolumeOff : "\uf026",
+ VolumeDown : "\uf027",
+ VolumeUp : "\uf028",
+ Qrcode : "\uf029",
+ Barcode : "\uf02a",
+ Tag : "\uf02b",
+ Tags : "\uf02c",
+ Book : "\uf02d",
+ Bookmark : "\uf02e",
+ Print : "\uf02f",
+ Camera : "\uf030",
+ Font : "\uf031",
+ Bold : "\uf032",
+ Italic : "\uf033",
+ TextHeight : "\uf034",
+ TextWidth : "\uf035",
+ AlignLeft : "\uf036",
+ AlignCenter : "\uf037",
+ AlignRight : "\uf038",
+ AlignJustify : "\uf039",
+ List : "\uf03a",
+ IndentLeft : "\uf03b",
+ IndentRight : "\uf03c",
+ FacetimeVideo : "\uf03d",
+ Picture : "\uf03e",
+ Pencil : "\uf040",
+ MapMarker : "\uf041",
+ Adjust : "\uf042",
+ Tint : "\uf043",
+ Edit : "\uf044",
+ Share : "\uf045",
+ Check : "\uf046",
+ Move : "\uf047",
+ StepBackward : "\uf048",
+ StepForward : "\uf049",
+ Backward : "\uf04a",
+ Play : "\uf04b",
+ Pause : "\uf04c",
+ Stop : "\uf04d",
+ Forward : "\uf04e",
+ FastForward : "\uf050",
+ StepForward : "\uf051",
+ Eject : "\uf052",
+ ChevronLeft : "\uf053",
+ ChevronRight : "\uf054",
+ PlusSign : "\uf055",
+ MinusSign : "\uf056",
+ RemoveSign : "\uf057",
+ OkSign : "\uf058",
+ QuestionSign : "\uf059",
+ InfoSign : "\uf05a",
+ Screenshot : "\uf05b",
+ RemoveCircle : "\uf05c",
+ OkCircle : "\uf05d",
+ BanCircle : "\uf05e",
+ ArrowLeft : "\uf060",
+ ArrowRight : "\uf061",
+ ArrowUp : "\uf062",
+ ArrowDown : "\uf063",
+ ShareAlt : "\uf064",
+ ResizeFull : "\uf065",
+ ResizeSmall : "\uf066",
+ Plus : "\uf067",
+ Minus : "\uf068",
+ Asterish : "\uf069",
+ ExclamationSign : "\uf06a",
+ Gift : "\uf06b",
+ Leave : "\uf06c",
+ Fire : "\uf06d",
+ EyeOpen : "\uf06e",
+ EyeClose : "\uf070",
+ WarningSign : "\uf071",
+ Plane : "\uf072",
+ Calendar : "\uf073",
+ Random : "\uf074",
+ Comment : "\uf075",
+ Magnet : "\uf076",
+ ChevronUp : "\uf077",
+ ChevronDown : "\uf078",
+ Retweet : "\uf079",
+ ShoppingCart : "\uf07a",
+ FolderClose : "\uf07b",
+ FolderOpen : "\uf07c",
+ ResizeVertical : "\uf07d",
+ ResizeHorizontal : "\uf07e",
+ BarChart : "\uf080",
+ TwitterSign : "\uf081",
+ FacebookSign : "\uf082",
+ CameraRetro : "\uf083",
+ Key : "\uf084",
+ Cogs : "\uf085",
+ Comments : "\uf086",
+ ThumbsUp : "\uf087",
+ ThumbsDown : "\uf088",
+ StarHalf : "\uf089",
+ HeartEmpty : "\uf08a",
+ Signout : "\uf08b",
+ LinkedinSign : "\uf08c",
+ Pushpin : "\uf08d",
+ ExternalLink : "\uf08e",
+ Signin : "\uf090",
+ Trophy : "\uf091",
+ GithubSign : "\uf092",
+ UploadAlt : "\uf093",
+ Lemon : "\uf094",
+ Phone : "\uf095",
+ CheckEmpty : "\uf096",
+ BookmarkEmpty : "\uf097",
+ PhoneSign : "\uf098",
+ Twitter : "\uf099",
+ Facebook : "\uf09a",
+ Github : "\uf09b",
+ Unlock : "\uf09c",
+ CreditCard : "\uf09d",
+ Rss : "\uf09e",
+ Hdd : "\uf0a0",
+ Bullhorn : "\uf0a1",
+ Bell : "\uf0a2",
+ Certificate : "\uf0a3",
+ HandRight : "\uf0a4",
+ HandLeft : "\uf0a5",
+ HandUp : "\uf0a6",
+ HandDown : "\uf0a7",
+ CircleArrowLeft : "\uf0a8",
+ CircleArrowRight : "\uf0a9",
+ CircleArrowUp : "\uf0aa",
+ CircleArrowDown : "\uf0ab",
+ Globe : "\uf0ac",
+ Wrench : "\uf0ad",
+ Tasks : "\uf0ae",
+ Filter : "\uf0b0",
+ Briefcase : "\uf0b1",
+ Fullscreen : "\uf0b2",
+ Group : "\uf0c0",
+ Link : "\uf0c1",
+ Cloud : "\uf0c2",
+ Beaker : "\uf0c3",
+ Cut : "\uf0c4",
+ Copy : "\uf0c5",
+ PaperClip : "\uf0c6",
+ Save : "\uf0c7",
+ SignBlank : "\uf0c8",
+ Reorder : "\uf0c9",
+ ListUl : "\uf0ca",
+ ListOl : "\uf0cb",
+ Strikethrough : "\uf0cc",
+ Underline : "\uf0cd",
+ Table : "\uf0ce",
+ Magic : "\uf0d0",
+ Truck : "\uf0d1",
+ Pinterest : "\uf0d2",
+ PinterestSign : "\uf0d3",
+ GooglePlusSign : "\uf0d4",
+ GooglePlus : "\uf0d5",
+ Money : "\uf0d6",
+ CaretDown : "\uf0d7",
+ CaretUp : "\uf0d8",
+ CaretLeft : "\uf0d9",
+ CaretRight : "\uf0da",
+ Columns : "\uf0db",
+ Sort : "\uf0dc",
+ SortDown : "\uf0dd",
+ SortUp : "\uf0de",
+ EnvelopeAlt : "\uf0e0",
+ Linkedin : "\uf0e1",
+ Undo : "\uf0e2",
+ Legal : "\uf0e3",
+ Dashboard : "\uf0e4",
+ CommentAlt : "\uf0e5",
+ CommentsAlt : "\uf0e6",
+ Bolt : "\uf0e7",
+ Sitemap : "\uf0e8",
+ Unbrella : "\uf0e9",
+ Paste : "\uf0ea",
+ ClosedCaptions : "\uf20a",
+ UserMd : "\uf200",
+};
+
diff --git a/playback/player/qt/imagesample.cpp b/playback/player/qt/imagesample.cpp
new file mode 100644
index 0000000..94c07d4
--- /dev/null
+++ b/playback/player/qt/imagesample.cpp
@@ -0,0 +1,61 @@
+/* GStreamer
+ *
+ * Copyright (C) 2015 Alexandre Moreno <alexmorenocano@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <QPainter>
+#include "imagesample.h"
+
+ImageSample::ImageSample()
+ : QQuickPaintedItem()
+ , sample_()
+{
+
+}
+
+ImageSample::~ImageSample()
+{
+
+}
+
+void ImageSample::paint(QPainter *painter)
+{
+ if (sample_.size().isEmpty())
+ return;
+
+ float aspect_ratio = sample_.width() / sample_.height();
+ int w = height() * aspect_ratio;
+ int x = (width() - w) / 2;
+
+ painter->setViewport(x, 0, w, height());
+ painter->drawImage(QRectF(0, 0, width(), height()), sample_);
+}
+
+const QImage &ImageSample::sample() const
+{
+ return sample_;
+}
+
+void ImageSample::setSample(const QImage &sample)
+{
+ sample_ = sample;
+ update();
+}
+
+
+
diff --git a/playback/player/qt/imagesample.h b/playback/player/qt/imagesample.h
new file mode 100644
index 0000000..917bb24
--- /dev/null
+++ b/playback/player/qt/imagesample.h
@@ -0,0 +1,46 @@
+/* GStreamer
+ *
+ * Copyright (C) 2015 Alexandre Moreno <alexmorenocano@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef IMAGESAMPLE_H
+#define IMAGESAMPLE_H
+
+#include <QObject>
+#include <QQuickPaintedItem>
+#include <QImage>
+#include <QPainter>
+#include "player.h"
+
+class ImageSample : public QQuickPaintedItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QImage sample READ sample WRITE setSample)
+public:
+ ImageSample();
+ ~ImageSample();
+ void paint(QPainter *painter);
+
+ const QImage &sample() const;
+ void setSample(const QImage &sample);
+
+private:
+ QImage sample_;
+};
+
+#endif // IMAGESAMPLE_H
diff --git a/playback/player/qt/main.cpp b/playback/player/qt/main.cpp
new file mode 100644
index 0000000..9a8adf6
--- /dev/null
+++ b/playback/player/qt/main.cpp
@@ -0,0 +1,78 @@
+/* GStreamer
+ *
+ * Copyright (C) 2015 Alexandre Moreno <alexmorenocano@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <QApplication>
+#include <QQmlApplicationEngine>
+#include <QCommandLineParser>
+#include <QStringList>
+#include <QUrl>
+
+#include "player.h"
+#include "imagesample.h"
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+ int result;
+
+ QCommandLineParser parser;
+ parser.setApplicationDescription("GstPlayer");
+ parser.addHelpOption();
+ parser.addPositionalArgument("urls",
+ QCoreApplication::translate("main", "URLs to play, optionally."), "[urls...]");
+ parser.process(app);
+
+ QList<QUrl> media_files;
+
+ const QStringList args = parser.positionalArguments();
+ foreach (const QString file, args) {
+ media_files << QUrl::fromUserInput(file);
+ }
+
+ qmlRegisterType<Player>("Player", 1, 0, "Player");
+ qmlRegisterType<ImageSample>("ImageSample", 1, 0, "ImageSample");
+
+ /* the plugin must be loaded before loading the qml file to register the
+ * GstGLVideoItem qml item
+ * FIXME Add a QQmlExtensionPlugin into qmlglsink to register GstGLVideoItem
+ * with the QML engine, then remove this */
+ gst_init(NULL,NULL);
+ GstElement *sink = gst_element_factory_make ("qmlglsink", NULL);
+ gst_object_unref(sink);
+
+
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
+
+ QObject *rootObject = engine.rootObjects().first();
+
+ Player *player = rootObject->findChild<Player*>("player");
+
+ QQuickItem *videoItem = rootObject->findChild<QQuickItem*>("videoItem");
+ player->setVideoOutput(videoItem);
+
+ if (!media_files.isEmpty())
+ player->setPlaylist(media_files);
+
+ result = app.exec();
+
+ gst_deinit ();
+ return result;
+}
diff --git a/playback/player/qt/main.qml b/playback/player/qt/main.qml
new file mode 100644
index 0000000..ce1cf8f
--- /dev/null
+++ b/playback/player/qt/main.qml
@@ -0,0 +1,732 @@
+/* GStreamer
+ *
+ * Copyright (C) 2015 Alexandre Moreno <alexmorenocano@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.4
+import QtQuick.Controls 1.1
+import QtQuick.Controls.Styles 1.3
+import QtQuick.Dialogs 1.2
+import QtQuick.Window 2.1
+import Player 1.0
+import org.freedesktop.gstreamer.GLVideoItem 1.0
+import ImageSample 1.0
+
+import "fontawesome.js" as FontAwesome
+
+ApplicationWindow {
+ id: window
+ visible: true
+ width: 640
+ height: 480
+ x: 30
+ y: 30
+ color: "black"
+// title : player.mediaInfo.title
+
+ Player {
+ id: player
+ objectName: "player"
+ volume: 0.5
+ positionUpdateInterval: 100
+ autoPlay: false
+
+ onStateChanged: {
+ if (state === Player.STOPPED) {
+ playbutton.state = "play"
+ }
+ }
+
+ onResolutionChanged: {
+ if (player.videoAvailable) {
+ window.width = resolution.width
+ window.height = resolution.height
+ }
+ }
+ }
+
+ GstGLVideoItem {
+ id: video
+ objectName: "videoItem"
+ anchors.centerIn: parent
+ width: parent.width
+ height: parent.height
+ visible: player.videoAvailable
+ }
+
+ ImageSample {
+ id: sample
+ anchors.centerIn: parent
+ sample: player.mediaInfo.sample
+ width: parent.width
+ height: parent.height
+ visible: !player.videoAvailable
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ onPositionChanged: {
+ playbar.opacity = 1.0
+ hidetimer.start()
+ }
+ }
+
+ Timer {
+ id: hidetimer
+ interval: 5000
+ onTriggered: {
+ if (!playbarMouseArea.containsMouse) {
+ playbar.opacity = 0.0
+ settings.visible = false
+ }
+ stop()
+ }
+ }
+
+ FileDialog {
+ id: fileDialog
+ //nameFilters: [TODO globs from mime types]
+ onAccepted: player.source = fileUrl
+ }
+
+ Action {
+ id: fileOpenAction
+ text: "Open"
+ onTriggered: fileDialog.open()
+ }
+
+ Item {
+ anchors.fill: parent
+ FontLoader {
+ source: "fonts/fontawesome-webfont.ttf"
+ }
+
+
+
+ Rectangle {
+ id : playbar
+ color: Qt.rgba(1, 1, 1, 0.7)
+ border.width: 1
+ border.color: "white"
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 15
+ anchors.horizontalCenter: parent.horizontalCenter
+ width : grid.width + 20
+ height: 40//childrenRect.height + 20
+ radius: 5
+ focus: true
+
+ MouseArea {
+ id: playbarMouseArea
+ anchors.fill: parent
+ hoverEnabled: true
+ }
+
+ Rectangle {
+ id: settings
+ width: 150; height: settingsView.contentHeight
+ color: Qt.rgba(1, 1, 1, 0.7)
+ anchors.right: parent.right
+ anchors.bottom: parent.top
+ anchors.bottomMargin: 3
+ border.width: 1
+ border.color: "white"
+ radius: 5
+ visible: false
+
+ ListModel {
+ id: settingsModel
+ ListElement {
+ name: "Video"
+ }
+ ListElement {
+ name: "Audio"
+ }
+ ListElement {
+ name: "Subtitle"
+ }
+ }
+
+ Component {
+ id: settingsDelegate
+ Item {
+ width: 150; height: 20
+ Text {
+ text: model.name
+ font.pixelSize: 13
+ anchors.centerIn: parent
+ }
+
+ Text {
+ font.pixelSize: 13
+ font.family: "FontAwesome"
+ text: FontAwesome.Icon.ChevronRight
+ anchors.right: parent.right
+ anchors.rightMargin: 10
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ switch(name) {
+ case 'Video':
+ videos.visible = true
+ break
+ case 'Audio':
+ audios.visible = true
+ break
+ case 'Subtitle' :
+ subtitles.visible = true
+ break
+ }
+ settings.visible = false
+ }
+ }
+ }
+ }
+
+ ListView {
+ id: settingsView
+ anchors.fill: parent
+ model: settingsModel
+ delegate: settingsDelegate
+ }
+ }
+
+ Rectangle {
+ id: videos
+ width: 150; height: videoView.contentHeight
+ color: Qt.rgba(1, 1, 1, 0.7)
+ anchors.right: parent.right
+ anchors.bottom: parent.top
+ anchors.bottomMargin: 3
+ border.width: 1
+ border.color: "white"
+ radius: 5
+
+ property bool selected: ListView.isCurrentItem
+ visible: false
+
+ Component {
+ id: videoDelegate
+ Item {
+ width: 150; height: 20
+ Text {
+ text: model.modelData.resolution.width + 'x' + model.modelData.resolution.height
+ font.pixelSize: 13
+ anchors.centerIn: parent
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ parent.ListView.view.currentIndex = index
+ player.currentVideo = model.modelData
+ }
+ }
+ }
+ }
+
+ ListView {
+ id : videoView
+ anchors.fill: parent
+ model: player.mediaInfo.videoStreams
+ delegate: videoDelegate
+ highlight: Rectangle {
+ color: "white"
+ radius: 5
+ border.width: 1
+ border.color: "white"
+ }
+ focus: true
+ clip: true
+ }
+ }
+
+ Rectangle {
+ id: audios
+ width: 150; height: audioView.contentHeight
+ color: Qt.rgba(1, 1, 1, 0.7)
+ anchors.right: parent.right
+ anchors.bottom: parent.top
+ anchors.bottomMargin: 3
+ border.width: 1
+ border.color: "white"
+ radius: 5
+
+ property bool selected: ListView.isCurrentItem
+ visible: false
+
+ Component {
+ id: audioDelegate
+ Item {
+ width: 150; height: 20
+ Text {
+ text: model.modelData.channels + 'channels'
+ font.pixelSize: 13
+ anchors.centerIn: parent
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ parent.ListView.view.currentIndex = index
+ player.currentAudio = model.modelData
+ }
+ }
+ }
+ }
+
+ ListView {
+ id : audioView
+ anchors.fill: parent
+ model: player.mediaInfo.audioStreams
+ delegate: audioDelegate
+ highlight: Rectangle {
+ color: "white"
+ radius: 5
+ border.width: 1
+ border.color: "white"
+ }
+ focus: true
+ clip: true
+ }
+ }
+
+ Rectangle {
+ id: subtitles
+ width: 150; height: subtitleView.contentHeight
+ color: Qt.rgba(1, 1, 1, 0.7)
+ anchors.right: parent.right
+ anchors.bottom: parent.top
+ anchors.bottomMargin: 3
+ border.width: 1
+ border.color: "white"
+ radius: 5
+
+ property bool selected: ListView.isCurrentItem
+ visible: false
+
+ Component {
+ id: subtitleDelegate
+ Item {
+ width: 150; height: 20
+ Text {
+ text: model.modelData.language
+ font.pixelSize: 13
+ anchors.centerIn: parent
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ parent.ListView.view.currentIndex = index
+ player.currentSubtitle = model.modelData
+ }
+ }
+ }
+ }
+
+ ListView {
+ id : subtitleView
+ anchors.fill: parent
+ model: player.mediaInfo.subtitleStreams
+ delegate: subtitleDelegate
+ highlight: Rectangle {
+ color: "white"
+ radius: 5
+ border.width: 1
+ border.color: "white"
+ }
+ focus: true
+ clip: true
+ }
+ }
+
+ Grid {
+ id: grid
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 7
+ rows: 1
+ verticalItemAlignment: Qt.AlignVCenter
+
+ Text {
+ id : openmedia
+ font.pixelSize: 17
+ font.family: "FontAwesome"
+ text: FontAwesome.Icon.FolderOpen
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: fileDialog.open()
+ }
+ }
+
+ Item {
+ width: 17
+ height: 17
+
+ Text {
+ anchors.centerIn: parent
+ font.pixelSize: 17
+ font.family: "FontAwesome"
+ text: FontAwesome.Icon.StepBackward
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: player.previous()
+ }
+ }
+
+ Item {
+ width: 25
+ height: 25
+
+ Text {
+ anchors.centerIn: parent
+ id : playbutton
+ font.family: "FontAwesome"
+ state: "play"
+
+ states: [
+ State {
+ name: "play"
+ PropertyChanges {
+ target: playbutton
+ text: FontAwesome.Icon.PlayCircle
+ font.pixelSize: 25
+ }
+ },
+ State {
+ name: "pause"
+ PropertyChanges {
+ target: playbutton
+ text: FontAwesome.Icon.Pause
+ font.pixelSize: 17
+ }
+ }
+ ]
+ }
+
+ MouseArea {
+ id: playArea
+ anchors.fill: parent
+ onPressed: {
+ if (player.state !== Player.PLAYING) {
+ player.play()
+ playbutton.state = "pause"
+ } else {
+ player.pause()
+ playbutton.state = "play"
+ }
+ }
+ }
+ }
+
+ Item {
+ width: 17
+ height: 17
+
+ Text {
+ anchors.centerIn: parent
+ font.pixelSize: 17
+ font.family: "FontAwesome"
+ text: FontAwesome.Icon.StepForward
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: player.next()
+ }
+ }
+
+ Item {
+ width: 40
+ height: 17
+ Text {
+ id: timelabel
+ anchors.centerIn: parent
+ font.pixelSize: 13
+ color: "black"
+ text: {
+ var current = new Date(Math.floor(slider.value / 1e6));
+ current.getMinutes() + ":" + ('0'+current.getSeconds()).slice(-2)
+ }
+ }
+ }
+
+ Item {
+ width: 200
+ height: 38
+ Text {
+ anchors.centerIn: parent
+ width: parent.width
+ text: player.mediaInfo.title
+ font.pixelSize: 15
+ elide: Text.ElideRight
+ }
+ }
+
+ Item {
+ width: 40
+ height: 17
+ Text {
+ id: durationlabel
+ anchors.centerIn: parent
+ font.pixelSize: 13
+ color: "black"
+ text: {
+ var duration = new Date(Math.floor(player.duration / 1e6));
+ duration.getMinutes() + ":" + ('0'+duration.getSeconds()).slice(-2)
+ }
+ }
+ }
+
+ Text {
+ id: sub
+ font.pixelSize: 17
+ font.family: "FontAwesome"
+ text: FontAwesome.Icon.ClosedCaptions
+ color: player.subtitleEnabled ? "red" : "black"
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ player.subtitleEnabled = !player.subtitleEnabled
+ }
+ }
+ }
+
+ Item {
+ width: 17
+ height: 17
+
+ Text {
+ id : volume
+ anchors.centerIn: parent
+ font.pixelSize: 17
+ font.family: "FontAwesome"
+ text: {
+ if (volumeslider.value > volumeslider.maximumValue / 2) {
+ FontAwesome.Icon.VolumeUp
+ } else if (volumeslider.value === 0) {
+ FontAwesome.Icon.VolumeOff
+ } else {
+ FontAwesome.Icon.VolumeDown
+ }
+ }
+ }
+
+ Rectangle {
+ id : volumebar
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.top
+ //anchors.bottomMargin:3
+ color: "lightgray"
+ width: 17
+ height: 66
+ visible: false
+ radius: 5
+
+ Slider {
+ id: volumeslider
+ value: player.volume
+ minimumValue: 0.0
+ maximumValue: 1.0
+ stepSize: 0.001
+ anchors.centerIn: parent
+ orientation: Qt.Vertical
+ onPressedChanged: player.volume = value
+
+ style: SliderStyle {
+ groove: Item {
+ implicitWidth: 47
+ implicitHeight: 3
+ anchors.centerIn: parent
+
+ Rectangle {
+ antialiasing: true
+ height: parent.height
+ width: parent.width
+ color: "gray"
+ opacity: 0.8
+ radius: 5
+
+ Rectangle {
+ antialiasing: true
+ height: parent.height
+ width: parent.width * control.value / control.maximumValue
+ color: "red"
+ radius: 5
+ }
+ }
+ }
+ handle: Rectangle {
+ anchors.centerIn: parent
+ color: control.pressed ? "white" : "lightgray"
+ border.color: "gray"
+ border.width: 1
+ implicitWidth: 11
+ implicitHeight: 11
+ radius: 90
+ }
+ }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ volumebar.visible = !volumebar.visible
+ }
+ }
+
+ MouseArea {
+ anchors.fill: volumebar
+ hoverEnabled: true
+ propagateComposedEvents: true
+
+ onClicked: mouse.accepted = false;
+ onPressed: mouse.accepted = false;
+ onReleased: mouse.accepted = false;
+ onDoubleClicked: mouse.accepted = false;
+ onPositionChanged: mouse.accepted = false;
+ onPressAndHold: mouse.accepted = false;
+
+ onExited: {
+ volumebar.visible = false
+ }
+ }
+
+ }
+
+ Text {
+ id: cog
+ font.pixelSize: 17
+ font.family: "FontAwesome"
+ text: FontAwesome.Icon.Cog
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ settings.visible = !settings.visible
+ videos.visible = false
+ audios.visible = false
+ subtitles.visible = false
+
+
+ }
+ }
+ }
+
+ Text {
+ id : fullscreen
+ font.pixelSize: 17
+ font.family: "FontAwesome"
+ text: FontAwesome.Icon.ResizeFull
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (window.visibility === Window.FullScreen) {
+ window.showNormal()
+ fullscreen.text = FontAwesome.Icon.ResizeFull
+ } else {
+ window.showFullScreen()
+ fullscreen.text = FontAwesome.Icon.ResizeSmall
+ }
+ }
+ }
+ }
+ }
+
+ Item {
+ width: playbar.width
+ height: 5
+ anchors.bottom: playbar.bottom
+
+ Slider {
+ id: slider
+ maximumValue: player.duration
+ value: player.position
+ onPressedChanged: player.seek(value)
+ onValueChanged: {
+ if (pressed)
+ player.seek(value)
+ }
+ enabled: player.mediaInfo.seekable
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ updateValueWhileDragging: true
+
+ MouseArea {
+ id: sliderMouseArea
+ anchors.fill: parent
+ hoverEnabled: true
+ propagateComposedEvents: true
+
+ onClicked: mouse.accepted = false;
+ onPressed: mouse.accepted = false;
+ onReleased: mouse.accepted = false;
+ onDoubleClicked: mouse.accepted = false;
+ onPositionChanged: mouse.accepted = false;
+ onPressAndHold: mouse.accepted = false;
+ }
+
+ style: SliderStyle {
+ groove: Item {
+ implicitWidth: playbar.width
+ implicitHeight: 5
+
+ Rectangle {
+ height: parent.height
+ width: parent.width
+ anchors.verticalCenter: parent.verticalCenter
+ color: "gray"
+ opacity: 0.8
+
+ Rectangle {
+ antialiasing: true
+ color: "red"
+ height: parent.height
+ width: parent.width * control.value / control.maximumValue
+ }
+
+ Rectangle {
+ antialiasing: true
+ color: "yellow"
+ height: parent.height
+ width: parent.width * player.buffering / 100
+ }
+ }
+ }
+ handle: Rectangle {
+ anchors.centerIn: parent
+ color: control.pressed ? "white" : "lightgray"
+ implicitWidth: 4
+ implicitHeight: 5
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/playback/player/qt/play.pro b/playback/player/qt/play.pro
new file mode 100644
index 0000000..87a1490
--- /dev/null
+++ b/playback/player/qt/play.pro
@@ -0,0 +1,48 @@
+TEMPLATE = app
+
+QT += qml quick widgets
+
+CONFIG += c++11
+
+DEFINES += GST_USE_UNSTABLE_API
+
+RESOURCES += qml.qrc
+
+# Additional import path used to resolve QML modules in Qt Creator's code model
+QML_IMPORT_PATH =
+
+# Default rules for deployment.
+include(deployment.pri)
+
+# not tested (yet)
+unix:!macx {
+QT_CONFIG -= no-pkg-config
+CONFIG += link_pkgconfig
+PKGCONFIG = \
+ gstreamer-1.0 \
+ gstreamer-player-1.0 \
+ gstreamer-tag-1.0
+}
+
+macx {
+ QMAKE_MAC_SDK = macosx10.9
+ INCLUDEPATH += /Library/Frameworks/GStreamer.framework/Headers
+
+ LIBS += \
+ -framework AppKit \
+ -F/Library/Frameworks -framework GStreamer
+}
+
+HEADERS += \
+ qgstplayer.h \
+ player.h \
+ quickrenderer.h \
+ imagesample.h
+
+SOURCES += main.cpp \
+ qgstplayer.cpp \
+ player.cpp \
+ quickrenderer.cpp \
+ imagesample.cpp
+
+DISTFILES +=
diff --git a/playback/player/qt/player.cpp b/playback/player/qt/player.cpp
new file mode 100644
index 0000000..3e2cade
--- /dev/null
+++ b/playback/player/qt/player.cpp
@@ -0,0 +1,41 @@
+
+/* GStreamer
+ *
+ * Copyright (C) 2015 Alexandre Moreno <alexmorenocano@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "player.h"
+#include "quickrenderer.h"
+
+Player::Player(QObject *parent)
+ : Player(parent, new QuickRenderer)
+{
+
+}
+
+Player::Player(QObject *parent, QuickRenderer *renderer)
+ : QGstPlayer::Player(parent, renderer)
+ , renderer_(renderer)
+{
+ renderer_->setParent(this);
+}
+
+void Player::setVideoOutput(QQuickItem *output)
+{
+ renderer_->setVideoItem(output);
+}
diff --git a/playback/player/qt/player.h b/playback/player/qt/player.h
new file mode 100644
index 0000000..34a0002
--- /dev/null
+++ b/playback/player/qt/player.h
@@ -0,0 +1,44 @@
+/* GStreamer
+ *
+ * Copyright (C) 2015 Alexandre Moreno <alexmorenocano@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef PLAYER_H
+#define PLAYER_H
+
+#include <QObject>
+#include <QQuickItem>
+#include "qgstplayer.h"
+
+class QuickRenderer;
+
+class Player : public QGstPlayer::Player
+{
+ Q_OBJECT
+public:
+ Player(QObject *parent = 0);
+ void setVideoOutput(QQuickItem *output);
+
+private:
+ Player(QObject *parent, QuickRenderer *renderer);
+ QuickRenderer *renderer_;
+};
+
+Q_DECLARE_METATYPE(Player*)
+
+#endif // PLAYER_H
diff --git a/playback/player/qt/qgstplayer.cpp b/playback/player/qt/qgstplayer.cpp
new file mode 100644
index 0000000..77112ef
--- /dev/null
+++ b/playback/player/qt/qgstplayer.cpp
@@ -0,0 +1,967 @@
+/* GStreamer
+ *
+ * Copyright (C) 2015 Alexandre Moreno <alexmorenocano@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "qgstplayer.h"
+#include <QDebug>
+#include <QSize>
+#include <QMetaObject>
+#include <functional>
+#include <QThread>
+#include <QtAlgorithms>
+#include <QImage>
+
+#include <gst/gst.h>
+#include <gst/tag/tag.h>
+
+namespace QGstPlayer {
+
+class RegisterMetaTypes
+{
+public:
+ RegisterMetaTypes()
+ {
+ qRegisterMetaType<Player::State>("State");
+ }
+
+} _register;
+
+MediaInfo::MediaInfo(Player *player)
+ : QObject(player)
+ , uri_()
+ , title_()
+ , isSeekable_(false)
+ , videoStreams_()
+ , audioStreams_()
+ , subtitleStreams_()
+ , sample_()
+{
+
+}
+
+QString MediaInfo::uri() const
+{
+ return uri_;
+}
+
+QString MediaInfo::title() const
+{
+ return title_;
+}
+
+bool MediaInfo::isSeekable() const
+{
+ return isSeekable_;
+}
+
+const QList<QObject *> &MediaInfo::videoStreams() const
+{
+ return videoStreams_;
+}
+
+const QList<QObject *> &MediaInfo::audioStreams() const
+{
+ return audioStreams_;
+}
+
+const QList<QObject*> &MediaInfo::subtitleStreams() const
+{
+ return subtitleStreams_;
+}
+
+const QImage &MediaInfo::sample()
+{
+ return sample_;
+}
+
+void MediaInfo::update(GstPlayerMediaInfo *info)
+{
+ Q_ASSERT(info != 0);
+
+ // FIXME since media-info signal gets emitted
+ // several times, we just update info iff the
+ // media uri has changed.
+ if (uri_ == gst_player_media_info_get_uri(info)) {
+ return;
+ }
+
+ uri_ = QString(gst_player_media_info_get_uri(info));
+
+ title_ = QString::fromLocal8Bit(gst_player_media_info_get_title(info));
+
+ // if media has no title, return the file name
+ if (title_.isEmpty()) {
+ QUrl url(gst_player_media_info_get_uri(info));
+ title_ = url.fileName();
+ }
+
+ emit titleChanged();
+
+ if (isSeekable_ != gst_player_media_info_is_seekable(info)) {
+ isSeekable_ = !isSeekable_;
+ emit seekableChanged();
+ }
+
+ if (!subtitleStreams_.isEmpty()) {
+ qDeleteAll(subtitleStreams_);
+ subtitleStreams_.clear();
+ }
+
+ if (!videoStreams_.isEmpty()) {
+ qDeleteAll(videoStreams_);
+ videoStreams_.clear();
+ }
+
+ if (!audioStreams_.isEmpty()) {
+ qDeleteAll(audioStreams_);
+ audioStreams_.clear();
+ }
+
+ GList *list = gst_player_get_subtitle_streams(info);
+
+ g_list_foreach (list, [](gpointer data, gpointer user_data) {
+ GstPlayerSubtitleInfo *info = static_cast<GstPlayerSubtitleInfo*>(data);
+ QList<QObject*> *subs = static_cast<QList<QObject*>*>(user_data);
+
+ subs->append(new SubtitleInfo(info));
+ }, &subtitleStreams_);
+
+ list = gst_player_get_video_streams(info);
+
+ g_list_foreach (list, [](gpointer data, gpointer user_data) {
+ GstPlayerVideoInfo *info = static_cast<GstPlayerVideoInfo*>(data);
+ QList<QObject*> *videos = static_cast<QList<QObject*>*>(user_data);
+
+ videos->append(new VideoInfo(info));
+ }, &videoStreams_);
+
+ list = gst_player_get_audio_streams(info);
+
+ g_list_foreach (list, [](gpointer data, gpointer user_data) {
+ GstPlayerAudioInfo *info = static_cast<GstPlayerAudioInfo*>(data);
+ QList<QObject*> *audios = static_cast<QList<QObject*>*>(user_data);
+
+ audios->append(new AudioInfo(info));
+ }, &audioStreams_);
+
+ GstSample *sample;
+ GstMapInfo map_info;
+ GstBuffer *buffer;
+ const GstStructure *caps_struct;
+ GstTagImageType type = GST_TAG_IMAGE_TYPE_UNDEFINED;
+
+ /* get image sample buffer from media */
+ sample = gst_player_media_info_get_image_sample (info);
+ if (!sample)
+ return;
+
+ buffer = gst_sample_get_buffer (sample);
+ caps_struct = gst_sample_get_info (sample);
+
+ /* if sample is retrieved from preview-image tag then caps struct
+ * will not be defined. */
+ if (caps_struct)
+ gst_structure_get_enum (caps_struct, "image-type",
+ GST_TYPE_TAG_IMAGE_TYPE, reinterpret_cast<gint*>(&type));
+
+ /* FIXME: Should we check more type ?? */
+ if ((type != GST_TAG_IMAGE_TYPE_FRONT_COVER) &&
+ (type != GST_TAG_IMAGE_TYPE_UNDEFINED) &&
+ (type != GST_TAG_IMAGE_TYPE_NONE)) {
+ g_print ("unsupport type ... %d \n", type);
+ return;
+ }
+
+ if (!gst_buffer_map (buffer, &map_info, GST_MAP_READ)) {
+ g_print ("failed to map gst buffer \n");
+ return;
+ }
+
+ sample_ = QImage::fromData(map_info.data, map_info.size);
+ if (sample_.isNull())
+ qWarning() << "failed to load media info sample image";
+
+ emit sampleChanged();
+
+ gst_buffer_unmap (buffer, &map_info);
+}
+
+VideoInfo::VideoInfo(GstPlayerVideoInfo *info)
+ : StreamInfo(reinterpret_cast<GstPlayerStreamInfo*>(info))
+ , video_(info)
+ , resolution_(gst_player_video_info_get_width(info), gst_player_video_info_get_height(info))
+{
+
+}
+
+QSize VideoInfo::resolution() const
+{
+ return resolution_;
+}
+
+AudioInfo::AudioInfo(GstPlayerAudioInfo *info)
+ : StreamInfo(reinterpret_cast<GstPlayerStreamInfo*>(info))
+ , audio_(info)
+ , language_(gst_player_audio_info_get_language(info))
+ , channels_(gst_player_audio_info_get_channels(info))
+ , bitRate_(gst_player_audio_info_get_bitrate(info))
+ , sampleRate_(gst_player_audio_info_get_sample_rate(info))
+{
+
+}
+
+const QString &AudioInfo::language() const
+{
+ return language_;
+}
+
+int AudioInfo::channels() const
+{
+ return channels_;
+}
+
+int AudioInfo::bitRate() const
+{
+ return bitRate_;
+}
+
+int AudioInfo::sampleRate() const
+{
+ return sampleRate_;
+}
+
+SubtitleInfo::SubtitleInfo(GstPlayerSubtitleInfo *info)
+ : StreamInfo(reinterpret_cast<GstPlayerStreamInfo*>(info))
+ , subtitle_(info)
+ , language_(gst_player_subtitle_info_get_language(info))
+{
+
+}
+
+const QString &SubtitleInfo::language() const
+{
+ return language_;
+}
+
+int StreamInfo::index() const
+{
+ return index_;
+}
+
+StreamInfo::StreamInfo(GstPlayerStreamInfo *info)
+ : stream_(info)
+ , index_(gst_player_stream_info_get_index(info))
+{
+
+}
+
+bool Player::isVideoAvailable() const
+{
+ GstPlayerVideoInfo *video_info;
+
+ video_info = gst_player_get_current_video_track (player_);
+ if (video_info) {
+ g_object_unref (video_info);
+ return true;
+ }
+
+ return false;
+}
+
+MediaInfo *Player::mediaInfo() const
+{
+ return mediaInfo_;
+}
+
+QVariant Player::currentVideo() const
+{
+ Q_ASSERT(player_ != 0);
+
+ GstPlayerVideoInfo *track = gst_player_get_current_video_track(player_);
+
+ if (!track)
+ return QVariant();
+
+ return QVariant::fromValue(new VideoInfo(track));
+}
+
+QVariant Player::currentAudio() const
+{
+ Q_ASSERT(player_ != 0);
+
+ GstPlayerAudioInfo *track = gst_player_get_current_audio_track(player_);
+
+ if (!track)
+ return QVariant();
+
+ return QVariant::fromValue(new AudioInfo(track));
+}
+
+QVariant Player::currentSubtitle() const
+{
+ Q_ASSERT(player_ != 0);
+
+ GstPlayerSubtitleInfo *track = gst_player_get_current_subtitle_track(player_);
+
+ if (!track)
+ return QVariant();
+
+ return QVariant::fromValue(new SubtitleInfo(track));
+}
+
+void Player::setCurrentVideo(QVariant track)
+{
+ Q_ASSERT(player_ != 0);
+
+ VideoInfo* info = track.value<VideoInfo*>();
+ Q_ASSERT(info);
+
+ gst_player_set_video_track(player_, info->index());
+}
+
+void Player::setCurrentAudio(QVariant track)
+{
+ Q_ASSERT(player_ != 0);
+
+ AudioInfo* info = track.value<AudioInfo*>();
+ Q_ASSERT(info);
+
+ gst_player_set_audio_track(player_, info->index());
+
+}
+
+void Player::setCurrentSubtitle(QVariant track)
+{
+ Q_ASSERT(player_ != 0);
+
+ SubtitleInfo* info = track.value<SubtitleInfo*>();
+ Q_ASSERT(info);
+
+ gst_player_set_subtitle_track(player_, info->index());
+}
+
+bool Player::isSubtitleEnabled() const
+{
+ return subtitleEnabled_;
+}
+
+quint32 Player::positionUpdateInterval() const
+{
+ Q_ASSERT(player_ != 0);
+
+ return gst_player_get_position_update_interval(player_);
+}
+
+void Player::setSubtitleEnabled(bool enabled)
+{
+ Q_ASSERT(player_ != 0);
+
+ subtitleEnabled_ = enabled;
+
+ gst_player_set_subtitle_track_enabled(player_, enabled);
+
+ emit subtitleEnabledChanged(enabled);
+}
+
+void Player::setPositionUpdateInterval(quint32 interval)
+{
+ Q_ASSERT(player_ != 0);
+
+ gst_player_set_position_update_interval(player_, interval);
+}
+
+Player::Player(QObject *parent, VideoRenderer *renderer)
+ : QObject(parent)
+ , player_()
+ , state_(STOPPED)
+ , videoDimensions_(QSize())
+ , mediaInfo_()
+ , videoAvailable_(false)
+ , subtitleEnabled_(false)
+ , autoPlay_(false)
+{
+
+ player_ = gst_player_new(renderer ? renderer->renderer() : 0,
+ gst_player_qt_signal_dispatcher_new(this));
+
+ g_object_connect(player_,
+ "swapped-signal::state-changed", G_CALLBACK (Player::onStateChanged), this,
+ "swapped-signal::position-updated", G_CALLBACK (Player::onPositionUpdated), this,
+ "swapped-signal::duration-changed", G_CALLBACK (Player::onDurationChanged), this,
+ "swapped-signal::buffering", G_CALLBACK (Player::onBufferingChanged), this,
+ "swapped-signal::video-dimensions-changed", G_CALLBACK (Player::onVideoDimensionsChanged), this,
+ "swapped-signal::volume-changed", G_CALLBACK (Player::onVolumeChanged), this,
+ "swapped-signal::mute-changed", G_CALLBACK (Player::onMuteChanged), this,
+ "swapped-signal::media-info-updated", G_CALLBACK (Player::onMediaInfoUpdated), this,
+ "swapped-signal::end-of-stream", G_CALLBACK (Player::onEndOfStreamReached), this, NULL);
+
+ mediaInfo_ = new MediaInfo(this);
+ gst_player_set_subtitle_track_enabled(player_, false);
+}
+
+Player::~Player()
+{
+ if (player_) {
+ g_signal_handlers_disconnect_by_data(player_, this);
+ gst_player_stop(player_);
+ g_object_unref(player_);
+ }
+}
+
+void
+Player::onStateChanged(Player * player, GstPlayerState state)
+{
+ player->state_ = static_cast<Player::State>(state);
+
+ emit player->stateChanged(player->state_);
+}
+
+void
+Player::onPositionUpdated(Player * player, GstClockTime position)
+{
+ emit player->positionUpdated(position);
+}
+
+void
+Player::onDurationChanged(Player * player, GstClockTime duration)
+{
+ emit player->durationChanged(duration);
+}
+
+void
+Player::onBufferingChanged(Player * player, int percent)
+{
+ emit player->bufferingChanged(percent);
+}
+
+void
+Player::onVideoDimensionsChanged(Player * player, int w, int h)
+{
+ QSize res(w,h);
+
+ if (res == player->videoDimensions_)
+ return;
+ player->videoDimensions_ = res;
+
+ player->setResolution(res);
+
+ emit player->resolutionChanged(res);
+}
+
+void
+Player::onVolumeChanged(Player *player)
+{
+ qreal new_val;
+
+ new_val = gst_player_get_volume (player->player_);
+
+ emit player->volumeChanged(new_val);
+}
+
+void
+Player::onMuteChanged(Player *player)
+{
+ bool new_val;
+
+ new_val = gst_player_get_mute (player->player_);
+
+ emit player->mutedChanged(new_val);
+}
+
+void
+Player::onMediaInfoUpdated(Player *player, GstPlayerMediaInfo *media_info)
+{
+ bool val = player->isVideoAvailable();
+
+ if (player->videoAvailable_ != val) {
+ player->videoAvailable_ = val;
+ emit player->videoAvailableChanged(val);
+ }
+
+ player->mediaInfo()->update(media_info);
+
+ emit player->mediaInfoChanged();
+}
+
+void Player::onEndOfStreamReached(Player *player)
+{
+ Q_ASSERT(player != 0);
+
+ emit player->endOfStream();
+}
+
+void Player::setUri(QUrl url)
+{
+ Q_ASSERT(player_ != 0);
+ QByteArray uri = url.toString().toLocal8Bit();
+
+ gst_player_set_uri(player_, uri.data());
+
+ autoPlay_ ? play() : pause();
+
+ emit sourceChanged(url);
+}
+
+QList<QUrl> Player::playlist() const
+{
+ return playlist_;
+}
+
+void Player::setPlaylist(const QList<QUrl> &playlist)
+{
+ if (!playlist_.isEmpty()) {
+ playlist_.erase(playlist_.begin(), playlist_.end());
+ }
+
+ playlist_ = playlist;
+
+ iter_ = playlist_.begin();
+ setUri(*iter_);
+}
+
+void Player::next()
+{
+ if (playlist_.isEmpty())
+ return;
+
+ if (iter_ == playlist_.end())
+ return;
+
+ setUri(*++iter_);
+}
+
+void Player::previous()
+{
+ if (playlist_.isEmpty())
+ return;
+
+ if (iter_ == playlist_.begin())
+ return;
+
+ setUri(*--iter_);
+}
+
+bool Player::autoPlay() const
+{
+ return autoPlay_;
+}
+
+void Player::setAutoPlay(bool auto_play)
+{
+ autoPlay_ = auto_play;
+
+ if (autoPlay_) {
+ connect(this, SIGNAL(endOfStream()), SLOT(next()));
+ }
+}
+
+QUrl Player::source() const
+{
+ Q_ASSERT(player_ != 0);
+
+ QString url = QString::fromLocal8Bit(gst_player_get_uri(player_));
+
+ return QUrl(url);
+}
+
+qint64 Player::duration() const
+{
+ Q_ASSERT(player_ != 0);
+
+ return gst_player_get_duration(player_);
+}
+
+qint64 Player::position() const
+{
+ Q_ASSERT(player_ != 0);
+
+ return gst_player_get_position(player_);
+}
+
+qreal Player::volume() const
+{
+ Q_ASSERT(player_ != 0);
+
+ return gst_player_get_volume(player_);
+}
+
+bool Player::isMuted() const
+{
+ Q_ASSERT(player_ != 0);
+
+ return gst_player_get_mute(player_);
+}
+
+int Player::buffering() const
+{
+ return 0;
+}
+
+QSize Player::resolution() const
+{
+ return videoDimensions_;
+}
+
+void Player::setResolution(QSize size)
+{
+ videoDimensions_ = size;
+}
+
+Player::State Player::state() const
+{
+ return state_;
+}
+
+GstElement *Player::pipeline() const
+{
+ Q_ASSERT(player_ != 0);
+
+ return gst_player_get_pipeline(player_);
+}
+
+void Player::play()
+{
+ Q_ASSERT(player_ != 0);
+
+ gst_player_play(player_);
+}
+
+void Player::pause()
+{
+ Q_ASSERT(player_ != 0);
+
+ gst_player_pause(player_);
+}
+
+void Player::stop()
+{
+ Q_ASSERT(player_ != 0);
+
+ gst_player_stop(player_);
+}
+
+void Player::seek(qint64 position)
+{
+ Q_ASSERT(player_ != 0);
+
+ gst_player_seek(player_, position);
+}
+
+void Player::setSource(QUrl const& url)
+{
+ Q_ASSERT(player_ != 0);
+
+ // discard playlist
+ if (!playlist_.isEmpty()) {
+ playlist_.erase(playlist_.begin(), playlist_.end());
+ }
+
+ setUri(url);
+
+ emit sourceChanged(url);
+}
+
+void Player::setVolume(qreal val)
+{
+ Q_ASSERT(player_ != 0);
+
+ gst_player_set_volume(player_, val);
+}
+
+void Player::setMuted(bool val)
+{
+ Q_ASSERT(player_ != 0);
+
+ gst_player_set_mute(player_, val);
+}
+
+void Player::setPosition(qint64 pos)
+{
+ Q_ASSERT(player_ != 0);
+
+ gst_player_seek(player_, pos);
+}
+
+GstPlayerVideoRenderer *VideoRenderer::renderer()
+{
+ return static_cast<GstPlayerVideoRenderer*> (gst_object_ref (renderer_));
+}
+
+VideoRenderer::VideoRenderer()
+{
+ renderer_ = static_cast<GstPlayerVideoRenderer*>
+ (g_object_new (GST_TYPE_PLAYER_QT_VIDEO_RENDERER, "renderer", this, NULL));
+}
+
+VideoRenderer::~VideoRenderer()
+{
+ if (renderer_) gst_object_unref(renderer_);
+}
+
+}
+
+struct _GstPlayerQtVideoRenderer
+{
+ GObject parent;
+
+ gpointer renderer;
+};
+
+struct _GstPlayerQtVideoRendererClass
+{
+ GObjectClass parent_class;
+};
+
+static void
+gst_player_qt_video_renderer_interface_init
+ (GstPlayerVideoRendererInterface * iface);
+
+G_DEFINE_TYPE_WITH_CODE (GstPlayerQtVideoRenderer,
+ gst_player_qt_video_renderer, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (GST_TYPE_PLAYER_VIDEO_RENDERER,
+ gst_player_qt_video_renderer_interface_init))
+
+enum
+{
+ QT_VIDEO_RENDERER_PROP_0,
+ QT_VIDEO_RENDERER_PROP_RENDERER,
+ QT_VIDEO_RENDERER_PROP_LAST
+};
+
+static GParamSpec * qt_video_renderer_param_specs
+ [QT_VIDEO_RENDERER_PROP_LAST] = { NULL, };
+
+static void
+gst_player_qt_video_renderer_set_property (GObject * object,
+ guint prop_id, const GValue * value, GParamSpec * pspec)
+{
+ GstPlayerQtVideoRenderer *self = GST_PLAYER_QT_VIDEO_RENDERER (object);
+
+ switch (prop_id) {
+ case QT_VIDEO_RENDERER_PROP_RENDERER:
+ self->renderer = g_value_get_pointer (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gst_player_qt_video_renderer_get_property (GObject * object,
+ guint prop_id, GValue * value, GParamSpec * pspec)
+{
+ GstPlayerQtVideoRenderer *self = GST_PLAYER_QT_VIDEO_RENDERER (object);
+
+ switch (prop_id) {
+ case QT_VIDEO_RENDERER_PROP_RENDERER:
+ g_value_set_pointer (value, self->renderer);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gst_player_qt_video_renderer_finalize (GObject * object)
+{
+ G_OBJECT_CLASS
+ (gst_player_qt_video_renderer_parent_class)->finalize(object);
+}
+
+static void
+gst_player_qt_video_renderer_class_init
+ (GstPlayerQtVideoRendererClass * klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property =
+ gst_player_qt_video_renderer_set_property;
+ gobject_class->get_property =
+ gst_player_qt_video_renderer_get_property;
+ gobject_class->finalize = gst_player_qt_video_renderer_finalize;
+
+ qt_video_renderer_param_specs
+ [QT_VIDEO_RENDERER_PROP_RENDERER] =
+ g_param_spec_pointer ("renderer", "Qt Renderer", "",
+ static_cast<GParamFlags>(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_properties (gobject_class,
+ QT_VIDEO_RENDERER_PROP_LAST,
+ qt_video_renderer_param_specs);
+}
+
+static void
+gst_player_qt_video_renderer_init (G_GNUC_UNUSED GstPlayerQtVideoRenderer * self)
+{
+
+}
+
+static GstElement *
+gst_player_qt_video_renderer_create_video_sink
+ (GstPlayerVideoRenderer * iface, G_GNUC_UNUSED GstPlayer *player)
+{
+ GstPlayerQtVideoRenderer *self = GST_PLAYER_QT_VIDEO_RENDERER (iface);
+
+ g_assert(self->renderer != NULL);
+
+ return static_cast<QGstPlayer::VideoRenderer*>(self->renderer)->createVideoSink();
+}
+
+static void
+gst_player_qt_video_renderer_interface_init
+ (GstPlayerVideoRendererInterface * iface)
+{
+ iface->create_video_sink = gst_player_qt_video_renderer_create_video_sink;
+}
+
+struct _GstPlayerQtSignalDispatcher
+{
+ GObject parent;
+
+ gpointer player;
+};
+
+struct _GstPlayerQtSignalDispatcherClass
+{
+ GObjectClass parent_class;
+};
+
+static void
+gst_player_qt_signal_dispatcher_interface_init
+ (GstPlayerSignalDispatcherInterface * iface);
+
+enum
+{
+ QT_SIGNAL_DISPATCHER_PROP_0,
+ QT_SIGNAL_DISPATCHER_PROP_PLAYER,
+ QT_SIGNAL_DISPATCHER_PROP_LAST
+};
+
+G_DEFINE_TYPE_WITH_CODE (GstPlayerQtSignalDispatcher,
+ gst_player_qt_signal_dispatcher, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (GST_TYPE_PLAYER_SIGNAL_DISPATCHER,
+ gst_player_qt_signal_dispatcher_interface_init));
+
+static GParamSpec
+* qt_signal_dispatcher_param_specs
+[QT_SIGNAL_DISPATCHER_PROP_LAST] = { NULL, };
+
+static void
+gst_player_qt_signal_dispatcher_finalize (GObject * object)
+{
+ G_OBJECT_CLASS
+ (gst_player_qt_signal_dispatcher_parent_class)->finalize
+ (object);
+}
+
+static void
+gst_player_qt_signal_dispatcher_set_property (GObject * object,
+ guint prop_id, const GValue * value, GParamSpec * pspec)
+{
+ GstPlayerQtSignalDispatcher *self =
+ GST_PLAYER_QT_SIGNAL_DISPATCHER (object);
+
+ switch (prop_id) {
+ case QT_SIGNAL_DISPATCHER_PROP_PLAYER:
+ self->player = g_value_get_pointer (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gst_player_qt_signal_dispatcher_get_property (GObject * object,
+ guint prop_id, GValue * value, GParamSpec * pspec)
+{
+ GstPlayerQtSignalDispatcher *self =
+ GST_PLAYER_QT_SIGNAL_DISPATCHER (object);
+
+ switch (prop_id) {
+ case QT_SIGNAL_DISPATCHER_PROP_PLAYER:
+ g_value_set_pointer (value, self->player);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+ gst_player_qt_signal_dispatcher_class_init
+ (GstPlayerQtSignalDispatcherClass * klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->finalize =
+ gst_player_qt_signal_dispatcher_finalize;
+ gobject_class->set_property =
+ gst_player_qt_signal_dispatcher_set_property;
+ gobject_class->get_property =
+ gst_player_qt_signal_dispatcher_get_property;
+
+ qt_signal_dispatcher_param_specs
+ [QT_SIGNAL_DISPATCHER_PROP_PLAYER] =
+ g_param_spec_pointer ("player", "Player instance", "",
+ static_cast<GParamFlags>(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_properties (gobject_class,
+ QT_SIGNAL_DISPATCHER_PROP_LAST,
+ qt_signal_dispatcher_param_specs);
+}
+
+static void
+gst_player_qt_signal_dispatcher_init
+ (G_GNUC_UNUSED GstPlayerQtSignalDispatcher * self)
+{
+
+}
+
+static void
+gst_player_qt_signal_dispatcher_dispatch (GstPlayerSignalDispatcher
+ * iface, G_GNUC_UNUSED GstPlayer * player, void (*emitter) (gpointer data), gpointer data,
+ GDestroyNotify destroy)
+{
+ GstPlayerQtSignalDispatcher *self = GST_PLAYER_QT_SIGNAL_DISPATCHER (iface);
+ QObject dispatch;
+ QObject *receiver = static_cast<QObject*>(self->player);
+
+ QObject::connect(&dispatch, &QObject::destroyed, receiver, [=]() {
+ emitter(data);
+ if (destroy) destroy(data);
+ }, Qt::QueuedConnection);
+}
+
+static void
+gst_player_qt_signal_dispatcher_interface_init
+(GstPlayerSignalDispatcherInterface * iface)
+{
+ iface->dispatch = gst_player_qt_signal_dispatcher_dispatch;
+}
+
+GstPlayerSignalDispatcher *
+gst_player_qt_signal_dispatcher_new (gpointer player)
+{
+ return static_cast<GstPlayerSignalDispatcher*>
+ (g_object_new (GST_TYPE_PLAYER_QT_SIGNAL_DISPATCHER,
+ "player", player, NULL));
+}
diff --git a/playback/player/qt/qgstplayer.h b/playback/player/qt/qgstplayer.h
new file mode 100644
index 0000000..8ff87d1
--- /dev/null
+++ b/playback/player/qt/qgstplayer.h
@@ -0,0 +1,316 @@
+/* GStreamer
+ *
+ * Copyright (C) 2015 Alexandre Moreno <alexmorenocano@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef QGSTPLAYER_H
+#define QGSTPLAYER_H
+
+#include <QObject>
+#include <QUrl>
+#include <QSize>
+//#include <QtGui/qwindowdefs.h>
+#include <QVariant>
+#include <QList>
+#include <QImage>
+#include <gst/player/player.h>
+
+namespace QGstPlayer {
+
+class VideoRenderer;
+class MediaInfo;
+class StreamInfo;
+class VideInfo;
+class AudioInfo;
+class SubtitleInfo;
+
+class Player : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
+ Q_PROPERTY(qint64 duration READ duration NOTIFY durationChanged)
+ Q_PROPERTY(qint64 position READ position NOTIFY positionUpdated)
+ Q_PROPERTY(quint32 positionUpdateInterval READ positionUpdateInterval
+ WRITE setPositionUpdateInterval)
+ Q_PROPERTY(qreal volume READ volume WRITE setVolume NOTIFY volumeChanged)
+ Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
+ Q_PROPERTY(int buffering READ buffering NOTIFY bufferingChanged)
+ Q_PROPERTY(QSize resolution READ resolution WRITE setResolution NOTIFY resolutionChanged)
+ Q_PROPERTY(State state READ state NOTIFY stateChanged)
+ Q_PROPERTY(QObject *mediaInfo READ mediaInfo NOTIFY mediaInfoChanged)
+ Q_PROPERTY(bool videoAvailable READ isVideoAvailable NOTIFY videoAvailableChanged)
+ Q_PROPERTY(QVariant currentVideo READ currentVideo WRITE setCurrentVideo)
+ Q_PROPERTY(QVariant currentAudio READ currentAudio WRITE setCurrentAudio)
+ Q_PROPERTY(QVariant currentSubtitle READ currentSubtitle WRITE setCurrentSubtitle)
+ Q_PROPERTY(bool subtitleEnabled READ isSubtitleEnabled WRITE setSubtitleEnabled
+ NOTIFY subtitleEnabledChanged)
+ Q_PROPERTY(bool autoPlay READ autoPlay WRITE setAutoPlay)
+ Q_PROPERTY(QList<QUrl> playlist READ playlist WRITE setPlaylist)
+
+ Q_ENUMS(State)
+
+public:
+ explicit Player(QObject *parent = 0, VideoRenderer *renderer = 0);
+ virtual ~Player();
+
+ typedef GstPlayerError Error;
+ enum State {
+ STOPPED = GST_PLAYER_STATE_STOPPED,
+ BUFFERING = GST_PLAYER_STATE_BUFFERING,
+ PAUSED = GST_PLAYER_STATE_PAUSED,
+ PLAYING = GST_PLAYER_STATE_PLAYING
+ };
+
+ QUrl source() const;
+ qint64 duration() const;
+ qint64 position() const;
+ qreal volume() const;
+ bool isMuted() const;
+ int buffering() const;
+ State state() const;
+ GstElement *pipeline() const;
+ QSize resolution() const;
+ void setResolution(QSize size);
+ bool isVideoAvailable() const;
+ MediaInfo *mediaInfo() const;
+ QVariant currentVideo() const;
+ QVariant currentAudio() const;
+ QVariant currentSubtitle() const;
+ bool isSubtitleEnabled() const;
+ quint32 positionUpdateInterval() const;
+ bool autoPlay() const;
+ QList<QUrl> playlist() const;
+
+signals:
+ void stateChanged(State new_state);
+ void bufferingChanged(int percent);
+ void endOfStream();
+ void positionUpdated(qint64 new_position);
+ void durationChanged(qint64 duration);
+ void resolutionChanged(QSize resolution);
+ void volumeChanged(qreal volume);
+ void mutedChanged(bool muted);
+ void mediaInfoChanged();
+ void sourceChanged(QUrl new_url);
+ void videoAvailableChanged(bool videoAvailable);
+ void subtitleEnabledChanged(bool enabled);
+
+public slots:
+ void play();
+ void pause();
+ void stop();
+ void seek(qint64 position);
+ void setSource(QUrl const& url);
+ void setVolume(qreal val);
+ void setMuted(bool val);
+ void setPosition(qint64 pos);
+ void setCurrentVideo(QVariant track);
+ void setCurrentAudio(QVariant track);
+ void setCurrentSubtitle(QVariant track);
+ void setSubtitleEnabled(bool enabled);
+ void setPositionUpdateInterval(quint32 interval);
+ void setPlaylist(const QList<QUrl> &playlist);
+ void next();
+ void previous();
+ void setAutoPlay(bool auto_play);
+
+private:
+ Q_DISABLE_COPY(Player)
+ static void onStateChanged(Player *, GstPlayerState state);
+ static void onPositionUpdated(Player *, GstClockTime position);
+ static void onDurationChanged(Player *, GstClockTime duration);
+ static void onBufferingChanged(Player *, int percent);
+ static void onVideoDimensionsChanged(Player *, int w, int h);
+ static void onVolumeChanged(Player *);
+ static void onMuteChanged(Player *);
+ static void onMediaInfoUpdated(Player *, GstPlayerMediaInfo *media_info);
+ static void onEndOfStreamReached(Player *);
+
+ void setUri(QUrl url);
+
+ GstPlayer *player_;
+ State state_;
+ QSize videoDimensions_;
+ MediaInfo *mediaInfo_;
+ bool videoAvailable_;
+ bool subtitleEnabled_;
+ bool autoPlay_;
+ QList<QUrl> playlist_;
+ QList<QUrl>::iterator iter_;
+};
+
+class VideoRenderer
+{
+public:
+ GstPlayerVideoRenderer *renderer();
+ virtual GstElement *createVideoSink() = 0;
+protected:
+ VideoRenderer();
+ virtual ~VideoRenderer();
+private:
+ GstPlayerVideoRenderer *renderer_;
+};
+
+class MediaInfo : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString uri READ uri NOTIFY uriChanged)
+ Q_PROPERTY(bool seekable READ isSeekable NOTIFY seekableChanged)
+ Q_PROPERTY(QString title READ title NOTIFY titleChanged)
+ Q_PROPERTY(QList<QObject*> videoStreams READ videoStreams CONSTANT)
+ Q_PROPERTY(QList<QObject*> audioStreams READ audioStreams CONSTANT)
+ Q_PROPERTY(QList<QObject*> subtitleStreams READ subtitleStreams CONSTANT)
+ Q_PROPERTY(QImage sample READ sample NOTIFY sampleChanged)
+
+public:
+ explicit MediaInfo(Player *player = 0);
+ QString uri() const;
+ QString title() const;
+ bool isSeekable() const;
+ const QList<QObject*> &videoStreams() const;
+ const QList<QObject*> &audioStreams() const;
+ const QList<QObject*> &subtitleStreams() const;
+ const QImage &sample();
+
+signals:
+ void uriChanged();
+ void seekableChanged();
+ void titleChanged();
+ void sampleChanged();
+
+public Q_SLOTS:
+ void update(GstPlayerMediaInfo *info);
+private:
+ QString uri_;
+ QString title_;
+ bool isSeekable_;
+ QList<QObject*> videoStreams_;
+ QList<QObject*> audioStreams_;
+ QList<QObject*> subtitleStreams_;
+ QImage sample_;
+};
+
+class StreamInfo : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int index READ index CONSTANT)
+public:
+ int index() const;
+
+protected:
+ StreamInfo(GstPlayerStreamInfo* info);
+private:
+ GstPlayerStreamInfo *stream_;
+ int index_;
+};
+
+class VideoInfo : public StreamInfo
+{
+ Q_OBJECT
+ Q_PROPERTY(QSize resolution READ resolution CONSTANT)
+public:
+ VideoInfo(GstPlayerVideoInfo *info);
+ QSize resolution() const;
+
+private:
+ GstPlayerVideoInfo *video_;
+ QSize resolution_;
+};
+
+class AudioInfo : public StreamInfo
+{
+ Q_OBJECT
+ Q_PROPERTY(QString language READ language CONSTANT)
+ Q_PROPERTY(int channels READ channels CONSTANT)
+ Q_PROPERTY(int bitRate READ bitRate CONSTANT)
+ Q_PROPERTY(int sampleRate READ sampleRate CONSTANT)
+
+public:
+ AudioInfo(GstPlayerAudioInfo *info);
+ QString const& language() const;
+ int channels() const;
+ int bitRate() const;
+ int sampleRate() const;
+
+private:
+ GstPlayerAudioInfo *audio_;
+ QString language_;
+ int channels_;
+ int bitRate_;
+ int sampleRate_;
+};
+
+class SubtitleInfo : public StreamInfo
+{
+ Q_OBJECT
+ Q_PROPERTY(QString language READ language CONSTANT)
+public:
+ SubtitleInfo(GstPlayerSubtitleInfo *info);
+ QString const& language() const;
+
+private:
+ GstPlayerSubtitleInfo *subtitle_;
+ QString language_;
+};
+
+}
+
+Q_DECLARE_METATYPE(QGstPlayer::Player*)
+Q_DECLARE_METATYPE(QGstPlayer::Player::State)
+Q_DECLARE_METATYPE(QGstPlayer::MediaInfo*)
+
+extern "C" {
+
+typedef struct _GstPlayerQtVideoRenderer
+ GstPlayerQtVideoRenderer;
+
+typedef struct _GstPlayerQtVideoRendererClass
+ GstPlayerQtVideoRendererClass;
+
+#define GST_TYPE_PLAYER_QT_VIDEO_RENDERER (gst_player_qt_video_renderer_get_type ())
+#define GST_IS_PLAYER_QT_VIDEO_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PLAYER_QT_VIDEO_RENDERER))
+#define GST_IS_PLAYER_QT_VIDEO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLAYER_QT_VIDEO_RENDERER))
+#define GST_PLAYER_QT_VIDEO_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PLAYER_QT_VIDEO_RENDERER, GstPlayerQtVideoRendererClass))
+#define GST_PLAYER_QT_VIDEO_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLAYER_QT_VIDEO_RENDERER, GstPlayerQtVideoRenderer))
+#define GST_PLAYER_QT_VIDEO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PLAYER_QT_VIDEO_RENDERER, GstPlayerQtVideoRendererClass))
+#define GST_PLAYER_QT_VIDEO_RENDERER_CAST(obj) ((GstPlayerQtVideoRenderer*)(obj))
+
+GType gst_player_qt_video_renderer_get_type (void);
+
+typedef struct _GstPlayerQtSignalDispatcher
+ GstPlayerQtSignalDispatcher;
+
+typedef struct _GstPlayerQtSignalDispatcherClass
+ GstPlayerQtSignalDispatcherClass;
+
+#define GST_TYPE_PLAYER_QT_SIGNAL_DISPATCHER (gst_player_qt_signal_dispatcher_get_type ())
+#define GST_IS_PLAYER_QT_SIGNAL_DISPATCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PLAYER_QT_SIGNAL_DISPATCHER))
+#define GST_IS_PLAYER_QT_SIGNAL_DISPATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLAYER_QT_SIGNAL_DISPATCHER))
+#define GST_PLAYER_QT_SIGNAL_DISPATCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PLAYER_QT_SIGNAL_DISPATCHER, GstPlayerQtSignalDispatcherClass))
+#define GST_PLAYER_QT_SIGNAL_DISPATCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLAYER_QT_SIGNAL_DISPATCHER, GstPlayerQtSignalDispatcher))
+#define GST_PLAYER_QT_SIGNAL_DISPATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PLAYER_QT_SIGNAL_DISPATCHER, GstPlayerQtSignalDispatcherClass))
+#define GST_PLAYER_QT_SIGNAL_DISPATCHER_CAST(obj) ((GstPlayerQtSignalDispatcher*)(obj))
+
+GType gst_player_qt_video_renderer_get_type (void);
+
+GstPlayerSignalDispatcher *
+gst_player_qt_signal_dispatcher_new (gpointer player);
+
+}
+
+#endif // QGSTPLAYER_H
diff --git a/playback/player/qt/qml.qrc b/playback/player/qt/qml.qrc
new file mode 100644
index 0000000..1052217
--- /dev/null
+++ b/playback/player/qt/qml.qrc
@@ -0,0 +1,9 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ <file>fontawesome.js</file>
+ </qresource>
+ <qresource prefix="/fonts">
+ <file>fontawesome-webfont.ttf</file>
+ </qresource>
+</RCC>
diff --git a/playback/player/qt/quickrenderer.cpp b/playback/player/qt/quickrenderer.cpp
new file mode 100644
index 0000000..5dd6853
--- /dev/null
+++ b/playback/player/qt/quickrenderer.cpp
@@ -0,0 +1,56 @@
+/* GStreamer
+ *
+ * Copyright (C) 2015 Alexandre Moreno <alexmorenocano@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "quickrenderer.h"
+
+QuickRenderer::QuickRenderer(QObject *parent)
+ : QObject(parent)
+ , QGstPlayer::VideoRenderer()
+ , sink()
+{
+
+}
+
+QuickRenderer::~QuickRenderer()
+{
+ if (sink) gst_object_unref(sink);
+}
+
+GstElement *QuickRenderer::createVideoSink()
+{
+ GstElement *qmlglsink = gst_element_factory_make("qmlglsink", NULL);
+
+ GstElement *glsinkbin = gst_element_factory_make ("glsinkbin", NULL);
+
+ Q_ASSERT(qmlglsink && glsinkbin);
+
+ g_object_set (glsinkbin, "sink", qmlglsink, NULL);
+
+ sink = static_cast<GstElement*>(gst_object_ref_sink(qmlglsink));
+
+ return glsinkbin;
+}
+
+void QuickRenderer::setVideoItem(QQuickItem *item)
+{
+ Q_ASSERT(item);
+
+ g_object_set(sink, "widget", item, NULL);
+}
diff --git a/playback/player/qt/quickrenderer.h b/playback/player/qt/quickrenderer.h
new file mode 100644
index 0000000..99519fb
--- /dev/null
+++ b/playback/player/qt/quickrenderer.h
@@ -0,0 +1,42 @@
+/* GStreamer
+ *
+ * Copyright (C) 2015 Alexandre Moreno <alexmorenocano@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef QUICKPLAYER_H
+#define QUICKPLAYER_H
+
+#include <QObject>
+#include <QQuickItem>
+#include "qgstplayer.h"
+
+class QuickRenderer : public QObject, public QGstPlayer::VideoRenderer
+{
+ Q_OBJECT
+public:
+ QuickRenderer(QObject *parent = 0);
+ ~QuickRenderer();
+
+ GstElement *createVideoSink();
+ void setVideoItem(QQuickItem *item);
+
+private:
+ GstElement *sink;
+};
+
+#endif // QUICKPLAYER_H