mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
Merge remote-tracking branch 'thib/master'
This commit is contained in:
commit
0267b3fc7d
76 changed files with 1462 additions and 1516 deletions
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : 2012.11 Brahmaputra
|
||||
# 2012.11 Brahmaputra
|
||||
|
||||
This page last changed on Nov 28, 2012 by slomo.
|
||||
|
||||
|
@ -282,4 +282,3 @@ Bug
|
|||
tracker: <https://bugs.freedesktop.org/enter_bug.cgi?product=GStreamer%20SDK>
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : 2012.5 Amazon
|
||||
# 2012.5 Amazon
|
||||
|
||||
This page last changed on Jun 15, 2012 by slomo.
|
||||
|
||||
|
@ -121,8 +121,6 @@ These use-cases are currently not officially supported by the GStreamer
|
|||
SDK but will usually work and will be officially supported in future
|
||||
releases of the GStreamer SDK.
|
||||
|
||||
|
||||
|
||||
The GStreamer SDK Amazon contains the following major components, some
|
||||
of them being optional or not used on some platforms.
|
||||
|
||||
|
@ -246,4 +244,3 @@ tracker: <https://bugs.freedesktop.org/enter_bug.cgi?product=GStreamer%20SDK>
|
|||
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:28
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : 2012.7 Amazon (Bugfix Release 1)
|
||||
# 2012.7 Amazon (Bugfix Release 1)
|
||||
|
||||
This page last changed on Jul 11, 2012 by slomo.
|
||||
|
||||
|
@ -138,8 +138,6 @@ These use-cases are currently not officially supported by the GStreamer
|
|||
SDK but will usually work and will be officially supported in future
|
||||
releases of the GStreamer SDK.
|
||||
|
||||
|
||||
|
||||
The GStreamer SDK Amazon contains the following major components, some
|
||||
of them being optional or not used on some platforms.
|
||||
|
||||
|
@ -264,4 +262,3 @@ tracker: <https://bugs.freedesktop.org/enter_bug.cgi?product=GStreamer%20SDK>
|
|||
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:28
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : 2012.9 Amazon (Bugfix Release 2)
|
||||
# 2012.9 Amazon (Bugfix Release 2)
|
||||
|
||||
This page last changed on Sep 18, 2012 by ylatuya.
|
||||
|
||||
|
@ -136,8 +136,6 @@ These use-cases are currently not officially supported by the GStreamer
|
|||
SDK but will usually work and will be officially supported in future
|
||||
releases of the GStreamer SDK.
|
||||
|
||||
|
||||
|
||||
The GStreamer SDK Amazon contains the following major components, some
|
||||
of them being optional or not used on some platforms.
|
||||
|
||||
|
@ -262,4 +260,3 @@ tracker: <https://bugs.freedesktop.org/enter_bug.cgi?product=GStreamer%20SDK>
|
|||
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:28
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : 2013.6 Congo
|
||||
# 2013.6 Congo
|
||||
|
||||
This page last changed on Jun 11, 2013 by ylatuya.
|
||||
|
||||
|
@ -303,4 +303,3 @@ Bug
|
|||
tracker: <https://bugs.freedesktop.org/enter_bug.cgi?product=GStreamer%20SDK>
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Android tutorial 1: Link against GStreamer
|
||||
# Android tutorial 1: Link against GStreamer
|
||||
|
||||
This page last changed on May 02, 2013 by xartigas.
|
||||
|
||||
|
@ -26,7 +26,7 @@ makefile that allows GStreamer integration.
|
|||
|
||||
**src/com/gst\_sdk\_tutorials/tutorial\_1/Tutorial1.java**
|
||||
|
||||
``` theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
package com.gst_sdk_tutorials.tutorial_1;
|
||||
|
||||
import android.app.Activity;
|
||||
|
@ -70,7 +70,7 @@ public class Tutorial1 extends Activity {
|
|||
Calls from Java to C happen through native methods, like the one
|
||||
declared here:
|
||||
|
||||
``` first-line: 11; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
private native String nativeGetGStreamerInfo();
|
||||
```
|
||||
|
||||
|
@ -82,7 +82,7 @@ shown later.
|
|||
The first bit of code that gets actually executed is the static
|
||||
initializer of the class:
|
||||
|
||||
``` first-line: 33; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
static {
|
||||
System.loadLibrary("gstreamer_android");
|
||||
System.loadLibrary("tutorial-1");
|
||||
|
@ -99,7 +99,7 @@ expose. The GStreamer library only exposes a `init()` method, which
|
|||
initializes GStreamer and registers all plugins (The tutorial library is
|
||||
explained later below).
|
||||
|
||||
``` first-line: 19; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
try {
|
||||
GStreamer.init(this);
|
||||
} catch (Exception e) {
|
||||
|
@ -122,7 +122,7 @@ Should initialization fail, the `init()` method would throw an
|
|||
[Exception](http://developer.android.com/reference/java/lang/Exception.html)
|
||||
with the details provided by the GStreamer library.
|
||||
|
||||
``` first-line: 29; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
TextView tv = (TextView)findViewById(R.id.textview_info);
|
||||
tv.setText("Welcome to " + nativeGetGStreamerInfo() + " !");
|
||||
```
|
||||
|
@ -139,7 +139,7 @@ code:
|
|||
|
||||
**jni/tutorial-1.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <string.h>
|
||||
#include <jni.h>
|
||||
#include <android/log.h>
|
||||
|
@ -179,7 +179,7 @@ Machine (VM) loads a library.
|
|||
Here, we retrieve the JNI environment needed to make calls that interact
|
||||
with Java:
|
||||
|
||||
``` first-line: 21; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
JNIEnv *env = NULL;
|
||||
|
||||
if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_4) != JNI_OK) {
|
||||
|
@ -192,7 +192,7 @@ And then locate the class containing the UI part of this tutorial using
|
|||
`
|
||||
FindClass()`:
|
||||
|
||||
``` first-line: 27; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
jclass klass = (*env)->FindClass (env, "com/gst_sdk_tutorials/tutorial_1/Tutorial1");
|
||||
```
|
||||
|
||||
|
@ -201,7 +201,7 @@ is, we provide the code for the methods we advertised in Java using the
|
|||
**`native`**
|
||||
keyword:
|
||||
|
||||
``` first-line: 28; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
(*env)->RegisterNatives (env, klass, native_methods, G_N_ELEMENTS(native_methods));
|
||||
```
|
||||
|
||||
|
@ -211,7 +211,7 @@ name, its [type
|
|||
signature](http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/types.html#wp276)
|
||||
and a pointer to the C function implementing it:
|
||||
|
||||
``` first-line: 16; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static JNINativeMethod native_methods[] = {
|
||||
{ "nativeGetGStreamerInfo", "()Ljava/lang/String;", (void *) gst_native_get_gstreamer_info}
|
||||
};
|
||||
|
@ -220,7 +220,7 @@ static JNINativeMethod native_methods[] = {
|
|||
The only native method used in this tutorial
|
||||
is `nativeGetGStreamerInfo()`:
|
||||
|
||||
``` first-line: 9; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
jstring gst_native_get_gstreamer_info (JNIEnv* env, jobject thiz) {
|
||||
char *version_utf8 = gst_version_string();
|
||||
jstring *version_jstring = (*env)->NewStringUTF(env, version_utf8);
|
||||
|
@ -241,7 +241,7 @@ must free the `char *` returned by `gst_version_string()`.
|
|||
|
||||
**jni/Android.mk**
|
||||
|
||||
``` theme: Default; brush: ruby; gutter: true
|
||||
``` lang=ruby
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
@ -294,4 +294,3 @@ As usual, it has been a pleasure having you here, and see you soon\!
|
|||
(image/png)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Android tutorial 2: A running pipeline
|
||||
# Android tutorial 2: A running pipeline
|
||||
|
||||
This page last changed on May 07, 2013 by xartigas.
|
||||
|
||||
|
@ -56,7 +56,7 @@ messages sent from the C code (for errors and state changes).
|
|||
|
||||
**src/com/gst\_sdk\_tutorials/tutorial\_2/Tutorial2.java**
|
||||
|
||||
``` theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
package com.gst_sdk_tutorials.tutorial_2;
|
||||
|
||||
import android.app.Activity;
|
||||
|
@ -181,7 +181,7 @@ public class Tutorial2 extends Activity {
|
|||
As usual, the first bit that gets executed is the static initializer of
|
||||
the class:
|
||||
|
||||
``` first-line: 113; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
static {
|
||||
System.loadLibrary("gstreamer_android");
|
||||
System.loadLibrary("tutorial-2");
|
||||
|
@ -198,7 +198,7 @@ In the `onCreate()` method GStreamer is initialized as in the previous
|
|||
tutorial with `GStreamer.init(this)`, and then the layout is inflated
|
||||
and listeners are setup for the two UI buttons:
|
||||
|
||||
``` first-line: 41; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
ImageButton play = (ImageButton) this.findViewById(R.id.button_play);
|
||||
play.setOnClickListener(new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
|
@ -224,7 +224,7 @@ and safer than tracking the actual pipeline state, because orientation
|
|||
changes can happen before the pipeline has moved to the desired state,
|
||||
for example.
|
||||
|
||||
``` first-line: 57; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
if (savedInstanceState != null) {
|
||||
is_playing_desired = savedInstanceState.getBoolean("playing");
|
||||
Log.i ("GStreamer", "Activity created. Saved state is playing:" + is_playing_desired);
|
||||
|
@ -239,7 +239,7 @@ We will first build the GStreamer pipeline (below) and only when the
|
|||
native code reports itself as initialized we will use
|
||||
`is_playing_desired`.
|
||||
|
||||
``` first-line: 69; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
nativeInit();
|
||||
```
|
||||
|
||||
|
@ -252,7 +252,7 @@ This finishes the `onCreate()` method and the Java initialization. The
|
|||
UI buttons are disabled, so nothing will happen until native code is
|
||||
ready and `onGStreamerInitialized()` is called:
|
||||
|
||||
``` first-line: 94; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
private void onGStreamerInitialized () {
|
||||
Log.i ("GStreamer", "Gst initialized. Restoring state, playing:" + is_playing_desired);
|
||||
```
|
||||
|
@ -261,7 +261,7 @@ This is called by the native code when its main loop is finally running.
|
|||
We first retrieve the desired playing state from `is_playing_desired`,
|
||||
and then set that state:
|
||||
|
||||
``` first-line: 96; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
// Restore previous playing state
|
||||
if (is_playing_desired) {
|
||||
nativePlay();
|
||||
|
@ -272,7 +272,7 @@ if (is_playing_desired) {
|
|||
|
||||
Here comes the first caveat, when re-enabling the UI buttons:
|
||||
|
||||
``` first-line: 103; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
// Re-enable buttons, now that GStreamer is initialized
|
||||
final Activity activity = this;
|
||||
runOnUiThread(new Runnable() {
|
||||
|
@ -300,7 +300,7 @@ The same problem exists when the native code wants to output a string in
|
|||
our TextView using the `setMessage()` method: it has to be done from the
|
||||
UI thread. The solution is the same:
|
||||
|
||||
``` first-line: 83; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
private void setMessage(final String message) {
|
||||
final TextView tv = (TextView) this.findViewById(R.id.textview_message);
|
||||
runOnUiThread (new Runnable() {
|
||||
|
@ -313,7 +313,7 @@ private void setMessage(final String message) {
|
|||
|
||||
Finally, a few remaining bits:
|
||||
|
||||
``` first-line: 72; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
protected void onSaveInstanceState (Bundle outState) {
|
||||
Log.d ("GStreamer", "Saving state, playing:" + is_playing_desired);
|
||||
outState.putBoolean("playing", is_playing_desired);
|
||||
|
@ -324,7 +324,7 @@ This method stores the currently desired playing state when Android is
|
|||
about to shut us down, so next time it restarts (after an orientation
|
||||
change, for example), it can restore the same state.
|
||||
|
||||
``` first-line: 77; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
protected void onDestroy() {
|
||||
nativeFinalize();
|
||||
super.onDestroy();
|
||||
|
@ -341,7 +341,7 @@ This concludes the UI part of the tutorial.
|
|||
|
||||
**jni/tutorial-2.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <string.h>
|
||||
#include <jni.h>
|
||||
#include <android/log.h>
|
||||
|
@ -624,7 +624,7 @@ the basic tutorials, and it is used to hold all our information in one
|
|||
place, so we can easily pass it around to
|
||||
callbacks:
|
||||
|
||||
``` first-line: 22; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Structure to contain all our information, so we can pass it to callbacks */
|
||||
typedef struct _CustomData {
|
||||
jobject app; /* Application instance, used to call its methods. A global reference is kept. */
|
||||
|
@ -651,7 +651,7 @@ the `long` type used in Java is always 64 bits wide, but the pointer
|
|||
used in C can be either 32 or 64 bits wide. The macros take care of the
|
||||
conversion without warnings.
|
||||
|
||||
``` first-line: 259; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Library initializer */
|
||||
jint JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
JNIEnv *env = NULL;
|
||||
|
@ -678,7 +678,7 @@ uses [pthread\_key\_create()](http://pubs.opengroup.org/onlinepubs/9699919799/f
|
|||
to be able to store per-thread information, which is crucial to properly
|
||||
manage the JNI Environment, as shown later.
|
||||
|
||||
``` first-line: 234; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Static class initializer: retrieve method and field IDs */
|
||||
static jboolean gst_native_class_init (JNIEnv* env, jclass klass) {
|
||||
custom_data_field_id = (*env)->GetFieldID (env, klass, "native_custom_data", "J");
|
||||
|
@ -716,7 +716,7 @@ from Java:
|
|||
|
||||
This method is called at the end of Java's `onCreate()`.
|
||||
|
||||
``` first-line: 191; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static void gst_native_init (JNIEnv* env, jobject thiz) {
|
||||
CustomData *data = g_new0 (CustomData, 1);
|
||||
SET_CUSTOM_DATA (env, thiz, custom_data_field_id, data);
|
||||
|
@ -725,7 +725,7 @@ static void gst_native_init (JNIEnv* env, jobject thiz) {
|
|||
It first allocates memory for the `CustomData` structure and passes the
|
||||
pointer to the Java class with `SET_CUSTOM_DATA`, so it is remembered.
|
||||
|
||||
``` first-line: 197; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
data->app = (*env)->NewGlobalRef (env, thiz);
|
||||
```
|
||||
|
||||
|
@ -734,7 +734,7 @@ in `CustomData` (a [Global
|
|||
Reference](http://developer.android.com/guide/practices/jni.html#local_and_global_references)
|
||||
is used) so its methods can be called later.
|
||||
|
||||
``` first-line: 199; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
pthread_create (&gst_app_thread, NULL, &app_function, data);
|
||||
```
|
||||
|
||||
|
@ -743,7 +743,7 @@ Finally, a thread is created and it starts running the
|
|||
|
||||
### `app_function()`
|
||||
|
||||
``` first-line: 134; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Main method for the native code. This is executed on its own thread. */
|
||||
static void *app_function (void *userdata) {
|
||||
JavaVMAttachArgs args;
|
||||
|
@ -766,7 +766,7 @@ is created with `g_main_context_new()` and then it is made the default
|
|||
one for the thread with
|
||||
`g_main_context_push_thread_default()`.
|
||||
|
||||
``` first-line: 149; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
data->pipeline = gst_parse_launch("audiotestsrc ! audioconvert ! audioresample ! autoaudiosink", &error);
|
||||
if (error) {
|
||||
gchar *message = g_strdup_printf("Unable to build pipeline: %s", error->message);
|
||||
|
@ -781,7 +781,7 @@ It then creates a pipeline the easy way, with `gst-parse-launch()`. In
|
|||
this case, it is simply an `audiotestsrc` (which produces a continuous
|
||||
tone) and an `autoaudiosink`, with accompanying adapter elements.
|
||||
|
||||
``` first-line: 159; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
bus = gst_element_get_bus (data->pipeline);
|
||||
bus_source = gst_bus_create_watch (bus);
|
||||
g_source_set_callback (bus_source, (GSourceFunc) gst_bus_async_signal_func, NULL, NULL);
|
||||
|
@ -798,7 +798,7 @@ creation of the watch is done step by step instead of using
|
|||
`gst_bus_add_signal_watch()` to exemplify how to use a custom GLib
|
||||
context.
|
||||
|
||||
``` first-line: 169; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
GST_DEBUG ("Entering main loop... (CustomData:%p)", data);
|
||||
data->main_loop = g_main_loop_new (data->context, FALSE);
|
||||
check_initialization_complete (data);
|
||||
|
@ -822,7 +822,7 @@ Once the main loop has quit, all resources are freed in lines 178 to
|
|||
|
||||
### `check_initialization_complete()`
|
||||
|
||||
``` first-line: 121; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static void check_initialization_complete (CustomData *data) {
|
||||
JNIEnv *env = get_jni_env ();
|
||||
if (!data->initialized && data->main_loop) {
|
||||
|
@ -866,7 +866,7 @@ see how it works, step by step:
|
|||
|
||||
### `get_jni_env()`
|
||||
|
||||
``` first-line: 68; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static JNIEnv *get_jni_env (void) {
|
||||
JNIEnv *env;
|
||||
if ((env = pthread_getspecific (current_jni_env)) == NULL) {
|
||||
|
@ -903,7 +903,7 @@ Let's now review the rest of the native methods accessible from Java:
|
|||
|
||||
### `gst_native_finalize()` (`nativeFinalize()` from Java)
|
||||
|
||||
``` first-line: 203; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static void gst_native_finalize (JNIEnv* env, jobject thiz) {
|
||||
CustomData *data = GET_CUSTOM_DATA (env, thiz, custom_data_field_id);
|
||||
if (!data) return;
|
||||
|
@ -952,7 +952,7 @@ error or state changed message and display a message in the UI using the
|
|||
|
||||
### `set_ui_message()`
|
||||
|
||||
``` first-line: 80; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static void set_ui_message (const gchar *message, CustomData *data) {
|
||||
JNIEnv *env = get_jni_env ();
|
||||
GST_DEBUG ("Setting message to: %s", message);
|
||||
|
@ -997,7 +997,7 @@ method and free the UTF16 message with
|
|||
|
||||
**jni/Android.mk**
|
||||
|
||||
``` theme: Default; brush: ruby; gutter: true
|
||||
``` lang=ruby
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
@ -1063,4 +1063,3 @@ As usual, it has been a pleasure having you here, and see you soon\!
|
|||
(image/png)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Android tutorial 3: Video
|
||||
# Android tutorial 3: Video
|
||||
|
||||
This page last changed on Nov 05, 2012 by xartigas.
|
||||
|
||||
|
@ -38,7 +38,7 @@ until a main loop is running and a drawing surface has been received.
|
|||
|
||||
**src/com/gst\_sdk\_tutorials/tutorial\_3/Tutorial3.java**
|
||||
|
||||
``` theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
package com.gst_sdk_tutorials.tutorial_3;
|
||||
|
||||
import android.app.Activity;
|
||||
|
@ -189,7 +189,7 @@ surface to the layout and changing the GStreamer pipeline to produce
|
|||
video instead of audio. Only the parts of the code that are new will be
|
||||
discussed.
|
||||
|
||||
``` first-line: 22; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
private native void nativeSurfaceInit(Object surface);
|
||||
private native void nativeSurfaceFinalize();
|
||||
```
|
||||
|
@ -199,7 +199,7 @@ Two new entry points to the C code are defined,
|
|||
when the video surface becomes available and when it is about to be
|
||||
destroyed, respectively.
|
||||
|
||||
``` first-line: 61; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
SurfaceView sv = (SurfaceView) this.findViewById(R.id.surface_video);
|
||||
SurfaceHolder sh = sv.getHolder();
|
||||
sh.addCallback(this);
|
||||
|
@ -214,7 +214,7 @@ interface. This is why we declared this Activity as implementing the
|
|||
[SurfaceHolder.Callback](http://developer.android.com/reference/android/view/SurfaceHolder.Callback.html)
|
||||
interface in line 16.
|
||||
|
||||
``` first-line: 127; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
public void surfaceChanged(SurfaceHolder holder, int format, int width,
|
||||
int height) {
|
||||
Log.d("GStreamer", "Surface changed to format " + format + " width "
|
||||
|
@ -245,7 +245,7 @@ Let’s review the C code to see what these functions do.
|
|||
|
||||
**jni/tutorial-3.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <string.h>
|
||||
#include <jni.h>
|
||||
#include <android/log.h>
|
||||
|
@ -589,7 +589,7 @@ First, our `CustomData` structure is augmented to keep a pointer to the
|
|||
video sink element and the native window
|
||||
handle:
|
||||
|
||||
``` first-line: 33; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
GstElement *video_sink; /* The video sink element which receives XOverlay commands */
|
||||
ANativeWindow *native_window; /* The Android native window where video will be rendered */
|
||||
```
|
||||
|
@ -598,7 +598,7 @@ The `check_initialization_complete()` method is also augmented so that
|
|||
it requires a native window before considering GStreamer to be
|
||||
initialized:
|
||||
|
||||
``` first-line: 127; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static void check_initialization_complete (CustomData *data) {
|
||||
JNIEnv *env = get_jni_env ();
|
||||
if (!data->initialized && data->native_window && data->main_loop) {
|
||||
|
@ -627,14 +627,14 @@ effects in the `GSTREAMER_PLUGINS_EFFECTS` package), and an
|
|||
`autovideosink` which will instantiate the adequate video sink for the
|
||||
platform:
|
||||
|
||||
``` first-line: 159; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
data->pipeline = gst_parse_launch("videotestsrc ! warptv ! ffmpegcolorspace ! autovideosink ", &error);
|
||||
```
|
||||
|
||||
Here things start to get more
|
||||
interesting:
|
||||
|
||||
``` first-line: 168; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Set the pipeline to READY, so it can already accept a window handle, if we have one */
|
||||
gst_element_set_state(data->pipeline, GST_STATE_READY);
|
||||
|
||||
|
@ -662,7 +662,7 @@ Now we will implement the two native functions called by the Java code
|
|||
when the drawing surface becomes available or is about to be
|
||||
destroyed:
|
||||
|
||||
``` first-line: 270; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static void gst_native_surface_init (JNIEnv *env, jobject thiz, jobject surface) {
|
||||
CustomData *data = GET_CUSTOM_DATA (env, thiz, custom_data_field_id);
|
||||
if (!data) return;
|
||||
|
@ -719,7 +719,7 @@ We finally store the new window handle and call
|
|||
`check_initialization_complete()` to inform the Java code that
|
||||
everything is set up, if that is the case.
|
||||
|
||||
``` first-line: 295; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static void gst_native_surface_finalize (JNIEnv *env, jobject thiz) {
|
||||
CustomData *data = GET_CUSTOM_DATA (env, thiz, custom_data_field_id);
|
||||
if (!data) return;
|
||||
|
@ -772,7 +772,7 @@ surface.
|
|||
|
||||
**src/com/gst\_sdk\_tutorials/tutorial\_3/GStreamerSurfaceView.java**
|
||||
|
||||
``` theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
package com.gst_sdk_tutorials.tutorial_3;
|
||||
|
||||
import android.content.Context;
|
||||
|
@ -864,7 +864,7 @@ public class GStreamerSurfaceView extends SurfaceView {
|
|||
|
||||
**/jni/Android.mk**
|
||||
|
||||
``` theme: Default; brush: ruby; gutter: true
|
||||
``` lang=ruby
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
@ -929,4 +929,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
(image/png)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Android tutorial 4: A basic media player
|
||||
# Android tutorial 4: A basic media player
|
||||
|
||||
This page last changed on May 21, 2013 by xartigas.
|
||||
|
||||
|
@ -49,7 +49,7 @@ this view is collapsed by default. Click here to expand…
|
|||
|
||||
**src/com/gst\_sdk\_tutorials/tutorial\_4/Tutorial4.java**
|
||||
|
||||
``` theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
package com.gst_sdk_tutorials.tutorial_4;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
@ -313,7 +313,7 @@ offer the same functionalities. We keep track of this in the
|
|||
`is_local_media` variable, and update it every time we change the media
|
||||
URI:
|
||||
|
||||
``` first-line: 132; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
private void setMediaUri() {
|
||||
nativeSetUri (mediaUri);
|
||||
is_local_media = mediaUri.startsWith("file://");
|
||||
|
@ -329,7 +329,7 @@ Every time the size of the media changes (which could happen mid-stream,
|
|||
for some kind of streams), or when it is first detected, C code calls
|
||||
our `onMediaSizeChanged()` callback:
|
||||
|
||||
``` first-line: 217; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
private void onMediaSizeChanged (int width, int height) {
|
||||
Log.i ("GStreamer", "Media size changed to " + width + "x" + height);
|
||||
final GStreamerSurfaceView gsv = (GStreamerSurfaceView) this.findViewById(R.id.surface_video);
|
||||
|
@ -371,7 +371,7 @@ To realize the first function, C code will periodically call our
|
|||
in the Seek Bar. Again we do so from the UI thread, using
|
||||
`RunOnUiThread()`.
|
||||
|
||||
``` first-line: 176; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
private void setCurrentPosition(final int position, final int duration) {
|
||||
final SeekBar sb = (SeekBar) this.findViewById(R.id.seek_bar);
|
||||
|
||||
|
@ -397,7 +397,7 @@ widget which we will use to display the current position and duration in
|
|||
`HH:mm:ss / HH:mm:ss` textual format. The `updateTimeWidget()` method
|
||||
takes care of it, and must be called every time the Seek Bar is updated:
|
||||
|
||||
``` first-line: 164; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
private void updateTimeWidget () {
|
||||
final TextView tv = (TextView) this.findViewById(R.id.textview_time);
|
||||
final SeekBar sb = (SeekBar) this.findViewById(R.id.seek_bar);
|
||||
|
@ -419,7 +419,7 @@ the user to seek by dragging the thumb), we implement the
|
|||
interface in the
|
||||
Activity:
|
||||
|
||||
``` first-line: 22; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
public class Tutorial4 extends Activity implements SurfaceHolder.Callback, OnSeekBarChangeListener {
|
||||
```
|
||||
|
||||
|
@ -427,7 +427,7 @@ And we register the Activity as the listener for the [Seek
|
|||
Bar](http://developer.android.com/reference/android/widget/SeekBar.html)’s
|
||||
events in the `onCreate()` method:
|
||||
|
||||
``` first-line: 80; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
SeekBar sb = (SeekBar) this.findViewById(R.id.seek_bar);
|
||||
sb.setOnSeekBarChangeListener(this);
|
||||
```
|
||||
|
@ -436,7 +436,7 @@ We will now be notified of three events: When the user starts dragging
|
|||
the thumb, every time the thumb moves and when the thumb is released by
|
||||
the user:
|
||||
|
||||
``` first-line: 239; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
public void onStartTrackingTouch(SeekBar sb) {
|
||||
nativePause();
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ pause the pipeline. If the user is searching for a particular scene, we
|
|||
do not want it to keep
|
||||
moving.
|
||||
|
||||
``` first-line: 230; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
public void onProgressChanged(SeekBar sb, int progress, boolean fromUser) {
|
||||
if (fromUser == false) return;
|
||||
desired_position = progress;
|
||||
|
@ -468,7 +468,7 @@ this is, we jump to the indicated position as soon as the thumb moves.
|
|||
Otherwise, the seek will be performed when the thumb is released, and
|
||||
the only thing we do here is update the textual time widget.
|
||||
|
||||
``` first-line: 244; theme: Default; brush: java; gutter: true
|
||||
``` lang=java
|
||||
public void onStopTrackingTouch(SeekBar sb) {
|
||||
// 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.
|
||||
|
@ -492,7 +492,7 @@ this view is collapsed by default. Click here to expand…
|
|||
|
||||
**jni/tutorial-4.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <string.h>
|
||||
#include <jni.h>
|
||||
#include <android/log.h>
|
||||
|
@ -1068,7 +1068,7 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved) {
|
|||
Java code will call `gst_native_set_uri()` whenever it wants to change
|
||||
the playing URI (in this tutorial the URI never changes, but it could):
|
||||
|
||||
``` first-line: 436; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
void gst_native_set_uri (JNIEnv* env, jobject thiz, jstring uri) {
|
||||
CustomData *data = GET_CUSTOM_DATA (env, thiz, custom_data_field_id);
|
||||
if (!data || !data->pipeline) return;
|
||||
|
@ -1116,7 +1116,7 @@ change during playback. For simplicity, this tutorial assumes that they
|
|||
do not. Therefore, in the READY to PAUSED state change, once the Caps of
|
||||
the decoded media are known, we inspect them in `check_media_size()`:
|
||||
|
||||
``` first-line: 252; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static void check_media_size (CustomData *data) {
|
||||
JNIEnv *env = get_jni_env ();
|
||||
GstElement *video_sink;
|
||||
|
@ -1167,7 +1167,7 @@ To keep the UI updated, a GLib timer is installed in the
|
|||
`app_function()` that fires 4 times per second (or every 250ms), right
|
||||
before entering the main loop:
|
||||
|
||||
``` first-line: 377; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
timeout_source = g_timeout_source_new (250);
|
||||
g_source_set_callback (timeout_source, (GSourceFunc)refresh_ui, data, NULL);
|
||||
g_source_attach (timeout_source, data->context);
|
||||
|
@ -1176,7 +1176,7 @@ g_source_unref (timeout_source);
|
|||
|
||||
Then, in the refresh\_ui method:
|
||||
|
||||
``` first-line: 126; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static gboolean refresh_ui (CustomData *data) {
|
||||
GstFormat fmt = GST_FORMAT_TIME;
|
||||
gint64 current = -1;
|
||||
|
@ -1230,7 +1230,7 @@ see how to overcome these problems.
|
|||
In
|
||||
`gst_native_set_position()`:
|
||||
|
||||
``` first-line: 468; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
void gst_native_set_position (JNIEnv* env, jobject thiz, int milliseconds) {
|
||||
CustomData *data = GET_CUSTOM_DATA (env, thiz, custom_data_field_id);
|
||||
if (!data) return;
|
||||
|
@ -1249,7 +1249,7 @@ away; otherwise, store the desired position in the
|
|||
`desired_position` variable. Then, in the
|
||||
`state_changed_cb()` callback:
|
||||
|
||||
``` first-line: 297; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
if (old_state == GST_STATE_READY && new_state == GST_STATE_PAUSED) {
|
||||
/* By now the sink already knows the media size */
|
||||
check_media_size(data);
|
||||
|
@ -1286,7 +1286,7 @@ once this period elapses.
|
|||
To achieve this, all seek requests are routed through the
|
||||
`execute_seek()` method:
|
||||
|
||||
``` first-line: 154; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static void execute_seek (gint64 desired_position, CustomData *data) {
|
||||
gint64 diff;
|
||||
|
||||
|
@ -1355,7 +1355,7 @@ using buffering. The same procedure is used here, by listening to the
|
|||
buffering
|
||||
messages:
|
||||
|
||||
``` first-line: 372; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
g_signal_connect (G_OBJECT (bus), "message::buffering", (GCallback)buffering_cb, data);
|
||||
```
|
||||
|
||||
|
@ -1363,7 +1363,7 @@ And pausing the pipeline until buffering is complete (unless this is a
|
|||
live
|
||||
source):
|
||||
|
||||
``` first-line: 224; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static void buffering_cb (GstBus *bus, GstMessage *msg, CustomData *data) {
|
||||
gint percent;
|
||||
|
||||
|
@ -1396,7 +1396,7 @@ is `GSTREAMER_PLUGINS`:
|
|||
|
||||
**jni/Android.mk**
|
||||
|
||||
``` first-line: 19; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_PLAYBACK) $(GSTREAMER_PLUGINS_CODECS) $(GSTREAMER_PLUGINS_NET) $(GSTREAMER_PLUGINS_SYS)
|
||||
```
|
||||
|
||||
|
@ -1431,4 +1431,3 @@ As usual, it has been a pleasure having you here, and see you soon\!
|
|||
(image/png)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Android tutorial 5: A Complete media player
|
||||
# Android tutorial 5: A Complete media player
|
||||
|
||||
This page last changed on Nov 28, 2012 by xartigas.
|
||||
|
||||
|
@ -111,4 +111,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
[ic\_media\_next.png](attachments/2687069/2654437.png) (image/png)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Android tutorials
|
||||
# Android tutorials
|
||||
|
||||
This page last changed on May 02, 2013 by xartigas.
|
||||
|
||||
|
@ -35,4 +35,3 @@ files
|
|||
in `$(ANDROID_NDK_ROOT)\platforms\android-9\arch-arm\usr\include\android`.
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Basic Media Player
|
||||
# Basic Media Player
|
||||
|
||||
This page last changed on May 24, 2013 by xartigas.
|
||||
|
||||
|
@ -28,7 +28,7 @@ each file to expand.
|
|||
|
||||
**CMakeLists.txt**
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
project(qtgst-example-player)
|
||||
find_package(QtGStreamer REQUIRED)
|
||||
# automoc is now a built-in tool since CMake 2.8.6.
|
||||
|
@ -52,7 +52,7 @@ target_link_libraries(player ${QTGSTREAMER_UI_LIBRARIES} ${QT_QTOPENGL_LIBRARIES
|
|||
|
||||
**main.cpp**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include "mediaapp.h"
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QGst/Init>
|
||||
|
@ -73,7 +73,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
**mediaapp.h**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#ifndef MEDIAAPP_H
|
||||
#define MEDIAAPP_H
|
||||
#include <QtCore/QTimer>
|
||||
|
@ -126,7 +126,7 @@ private:
|
|||
|
||||
**mediaapp.cpp**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include "mediaapp.h"
|
||||
#include "player.h"
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||
|
@ -326,7 +326,7 @@ void MediaApp::createUI(QBoxLayout *appLayout)
|
|||
|
||||
**player.h**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#ifndef PLAYER_H
|
||||
#define PLAYER_H
|
||||
#include <QtCore/QTimer>
|
||||
|
@ -374,7 +374,7 @@ private:
|
|||
|
||||
**player.cpp**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include "player.h"
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QUrl>
|
||||
|
@ -555,7 +555,7 @@ We begin by looking at `main()`:
|
|||
|
||||
**main.cpp**
|
||||
|
||||
``` first-line: 4; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
@ -584,7 +584,7 @@ the UI:
|
|||
|
||||
**MediaApp::MediaApp()**
|
||||
|
||||
``` first-line: 20; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
//create the player
|
||||
m_player = new Player(this);
|
||||
connect(m_player, SIGNAL(positionChanged()), this, SLOT(onPositionChanged()));
|
||||
|
@ -596,7 +596,7 @@ line, if any:
|
|||
|
||||
**MediaApp::openFile()**
|
||||
|
||||
``` first-line: 43; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
void MediaApp::openFile(const QString & fileName)
|
||||
{
|
||||
m_baseDir = QFileInfo(fileName).path();
|
||||
|
@ -610,7 +610,7 @@ This in turn instructs the `Player` to construct our GStreamer pipeline:
|
|||
|
||||
**Player::setUri()**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
void Player::setUri(const QString & uri)
|
||||
{
|
||||
QString realUri = uri;
|
||||
|
@ -650,7 +650,7 @@ rendering. For clarity, here is a portion of the implementation:
|
|||
|
||||
**prepare-xwindow-id handling**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
QGlib::connect(pipeline->bus(), "sync-message",
|
||||
this, &PipelineWatch::onBusSyncMessage);
|
||||
...
|
||||
|
@ -666,7 +666,7 @@ void PipelineWatch::onBusSyncMessage(const MessagePtr & msg)
|
|||
Once the pipeline is created, we connect to the bus' message signal (via
|
||||
`QGlib::connect()`) to dispatch state change signals:
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
void Player::onBusMessage(const QGst::MessagePtr & message)
|
||||
{
|
||||
switch (message->type()) {
|
||||
|
@ -708,7 +708,7 @@ void Player::handlePipelineStateChange(const QGst::StateChangedMessagePtr & scm)
|
|||
|
||||
Finally, we tell `playbin2` what to play by setting the `uri` property:
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: false
|
||||
``` lang=c
|
||||
m_pipeline->setProperty("uri", realUri);
|
||||
```
|
||||
|
||||
|
@ -719,7 +719,7 @@ After `Player::setUri()` is called, `MediaApp::openFile()` calls
|
|||
|
||||
**Player::play()**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
void Player::play()
|
||||
{
|
||||
if (m_pipeline) {
|
||||
|
@ -732,7 +732,7 @@ The other state control methods are equally simple:
|
|||
|
||||
**Player state functions**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
void Player::pause()
|
||||
{
|
||||
if (m_pipeline) {
|
||||
|
@ -756,7 +756,7 @@ is emitted on the GStreamer bus which gets picked up by the `Player`:
|
|||
|
||||
**Player::onBusMessage()**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
void Player::onBusMessage(const QGst::MessagePtr & message)
|
||||
{
|
||||
switch (message->type()) {
|
||||
|
@ -783,7 +783,7 @@ handled:
|
|||
|
||||
**MediaApp::onStateChanged()**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
void MediaApp::onStateChanged()
|
||||
{
|
||||
QGst::State newState = m_player->state();
|
||||
|
@ -812,7 +812,7 @@ UI to handle:
|
|||
|
||||
**MediaApp::onPositionChanged()**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
void MediaApp::onPositionChanged()
|
||||
{
|
||||
QTime length(0,0);
|
||||
|
@ -844,7 +844,7 @@ to `gst_element_query_position()`:
|
|||
|
||||
**Player::position()**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
QTime Player::position() const
|
||||
{
|
||||
if (m_pipeline) {
|
||||
|
@ -874,4 +874,3 @@ This tutorial has shown:
|
|||
It has been a pleasure having you here, and see you soon\!
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -240,4 +240,3 @@ The next tutorial will keep introducing more basic GStreamer elements,
|
|||
and show you how to build a pipeline manually.
|
||||
|
||||
It has been a pleasure having you here, and see you soon!
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Basic tutorial 10: GStreamer tools
|
||||
# Basic tutorial 10: GStreamer tools
|
||||
|
||||
This page last changed on Jun 01, 2012 by xartigas.
|
||||
|
||||
|
@ -74,7 +74,7 @@ In simple form, a PIPELINE-DESCRIPTION is a list of element types
|
|||
separated by exclamation marks (\!). Go ahead and type in the following
|
||||
command:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10 videotestsrc ! ffmpegcolorspace ! autovideosink
|
||||
```
|
||||
|
||||
|
@ -98,7 +98,7 @@ spaces). Use the `gst-inspect` tool (explained next) to find out the
|
|||
available properties for an
|
||||
element.
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10 videotestsrc pattern=11 ! ffmpegcolorspace ! autovideosink
|
||||
```
|
||||
|
||||
|
@ -115,7 +115,7 @@ example.
|
|||
Named elements are referred to using their name followed by a
|
||||
dot.
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10 videotestsrc ! ffmpegcolorspace ! tee name=t ! queue ! autovideosink t. ! queue ! autovideosink
|
||||
```
|
||||
|
||||
|
@ -149,7 +149,7 @@ This is useful, for example, when you want to retrieve one particular
|
|||
stream out of a
|
||||
demuxer:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10.exe souphttpsrc location=http://docs.gstreamer.com/media/sintel_trailer-480p.webm ! matroskademux name=d d.video_00 ! matroskamux ! filesink location=sintel_video.mkv
|
||||
```
|
||||
|
||||
|
@ -169,7 +169,7 @@ All in all, we took a webm file, stripped it of audio, and generated a
|
|||
new matroska file with the video. If we wanted to keep only the
|
||||
audio:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10.exe souphttpsrc location=http://docs.gstreamer.com/media/sintel_trailer-480p.webm ! matroskademux name=d d.audio_00 ! vorbisparse ! matroskamux ! filesink location=sintel_audio.mka
|
||||
```
|
||||
|
||||
|
@ -195,7 +195,7 @@ saying that GStreamer will choose one output pad at random.
|
|||
Consider the following
|
||||
pipeline:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10 souphttpsrc location=http://docs.gstreamer.com/media/sintel_trailer-480p.webm ! matroskademux ! filesink location=test
|
||||
```
|
||||
|
||||
|
@ -209,7 +209,7 @@ You can remove this ambiguity, though, by using named pads, as in the
|
|||
previous sub-section, or by using **Caps
|
||||
Filters**:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10 souphttpsrc location=http://docs.gstreamer.com/media/sintel_trailer-480p.webm ! matroskademux ! video/x-vp8 ! matroskamux ! filesink location=sintel_video.mkv
|
||||
```
|
||||
|
||||
|
@ -230,7 +230,7 @@ producing for a particular pipeline, run `gst-launch` as usual, with the
|
|||
Play a media file using `playbin2` (as in [Basic tutorial 1: Hello
|
||||
world\!](Basic%2Btutorial%2B1%253A%2BHello%2Bworld%2521.html)):
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10 playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm
|
||||
```
|
||||
|
||||
|
@ -238,7 +238,7 @@ A fully operation playback pipeline, with audio and video (more or less
|
|||
the same pipeline that `playbin2` will create
|
||||
internally):
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10 souphttpsrc location=http://docs.gstreamer.com/media/sintel_trailer-480p.webm ! matroskademux name=d ! queue ! vp8dec ! ffmpegcolorspace ! autovideosink d. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink
|
||||
```
|
||||
|
||||
|
@ -248,7 +248,7 @@ with a different codec, and puts them back together in an Ogg container
|
|||
(just for the sake of
|
||||
it).
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10 uridecodebin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm name=d ! queue ! theoraenc ! oggmux name=m ! filesink location=sintel.ogg d. ! queue ! audioconvert ! audioresample ! flacenc ! m.
|
||||
```
|
||||
|
||||
|
@ -257,7 +257,7 @@ operation whenever the frame size is different in the input and the
|
|||
output caps. The output caps are set by the Caps Filter to
|
||||
320x200.
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10 uridecodebin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm ! queue ! videoscale ! video/x-raw-yuv,width=320,height=200 ! ffmpegcolorspace ! autovideosink
|
||||
```
|
||||
|
||||
|
@ -279,7 +279,7 @@ This tool has three modes of operation:
|
|||
|
||||
Let's see an example of the third mode:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
gst-inspect-0.10 vp8dec
|
||||
|
||||
Factory Details:
|
||||
|
@ -400,7 +400,7 @@ which basically control the amount of verbosity of the output.
|
|||
Let's see an
|
||||
example:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-discoverer-0.10 http://docs.gstreamer.com/media/sintel_trailer-480p.webm -v
|
||||
|
||||
Analyzing http://docs.gstreamer.com/media/sintel_trailer-480p.webm
|
||||
|
@ -465,4 +465,3 @@ This tutorial has shown:
|
|||
It has been a pleasure having you here, and see you soon\!
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Basic tutorial 11: Debugging tools
|
||||
# Basic tutorial 11: Debugging tools
|
||||
|
||||
This page last changed on Jun 04, 2012 by xartigas.
|
||||
|
||||
|
@ -28,7 +28,7 @@ The debug output is controlled with the `GST_DEBUG` environment
|
|||
variable. Here’s an example with
|
||||
`GST_DEBUG=2`:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
0:00:00.868050000 1592 09F62420 WARN filesrc gstfilesrc.c:1044:gst_file_src_start:<filesrc0> error: No such file "non-existing-file.webm"
|
||||
```
|
||||
|
||||
|
@ -97,7 +97,7 @@ specific messages.
|
|||
The content of each line in the debug output
|
||||
is:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
0:00:00.868050000 1592 09F62420 WARN filesrc gstfilesrc.c:1044:gst_file_src_start:<filesrc0> error: No such file "non-existing-file.webm"
|
||||
```
|
||||
|
||||
|
@ -159,7 +159,7 @@ as the Debug category in the output log).
|
|||
To change the category to something more meaningful, add these two lines
|
||||
at the top of your code:
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
GST_DEBUG_CATEGORY_STATIC (my_category);
|
||||
#define GST_CAT_DEFAULT my_category
|
||||
```
|
||||
|
@ -167,7 +167,7 @@ GST_DEBUG_CATEGORY_STATIC (my_category);
|
|||
And then this one after you have initialized GStreamer with
|
||||
`gst_init()`:
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: false
|
||||
``` lang=c
|
||||
GST_DEBUG_CATEGORY_INIT (my_category, "my category", 0, "This is my very own");
|
||||
```
|
||||
|
||||
|
@ -229,4 +229,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
[playbin2.png](attachments/327830/2424840.png) (image/png)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Basic tutorial 12: Streaming
|
||||
# Basic tutorial 12: Streaming
|
||||
|
||||
This page last changed on Sep 28, 2012 by xartigas.
|
||||
|
||||
|
@ -62,7 +62,7 @@ Copy this code into a text file named `basic-tutorial-12.c`.
|
|||
|
||||
**basic-tutorial-12.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <gst/gst.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -195,7 +195,7 @@ therefore, the initialization code is very simple and should be
|
|||
self-explanative by now. The only new bit is the detection of live
|
||||
streams:
|
||||
|
||||
``` first-line: 74; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Start playing */
|
||||
ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||
if (ret == GST_STATE_CHANGE_FAILURE) {
|
||||
|
@ -221,7 +221,7 @@ them, so we take note of the result of `gst_element_set_state()` in the
|
|||
|
||||
Let’s now review the interesting parts of the message parsing callback:
|
||||
|
||||
``` first-line: 31; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
case GST_MESSAGE_BUFFERING: {
|
||||
gint percent = 0;
|
||||
|
||||
|
@ -254,7 +254,7 @@ network becomes slow or unresponsive and our buffer depletes, we will
|
|||
receive new buffering messages with levels below 100% so we will pause
|
||||
the pipeline again until enough buffer has been built up.
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: false
|
||||
``` lang=c
|
||||
case GST_MESSAGE_CLOCK_LOST:
|
||||
/* Get a new clock */
|
||||
gst_element_set_state (data->pipeline, GST_STATE_PAUSED);
|
||||
|
@ -287,4 +287,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
[vs2010.zip](attachments/327806/2424844.zip) (application/zip)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Basic tutorial 13: Playback speed
|
||||
# Basic tutorial 13: Playback speed
|
||||
|
||||
This page last changed on Jul 06, 2012 by xartigas.
|
||||
|
||||
|
@ -69,7 +69,7 @@ Copy this code into a text file named `basic-tutorial-13.c`.
|
|||
|
||||
**basic-tutorial-13.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <string.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
|
@ -250,7 +250,7 @@ keystrokes and a GLib main loop is executed.
|
|||
|
||||
Then, in the keyboard handler function:
|
||||
|
||||
``` first-line: 45; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Process keyboard input */
|
||||
static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomData *data) {
|
||||
gchar *str = NULL;
|
||||
|
@ -270,7 +270,7 @@ static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomDa
|
|||
Pause / Playing toggle is handled with `gst_element_set_state()` as in
|
||||
previous tutorials.
|
||||
|
||||
``` first-line: 59; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
case 's':
|
||||
if (g_ascii_isupper (str[0])) {
|
||||
data->rate *= 2.0;
|
||||
|
@ -290,7 +290,7 @@ reverse the current playback direction. In both cases, the
|
|||
`rate` variable is updated and `send_seek_event` is called. Let’s
|
||||
review this function.
|
||||
|
||||
``` first-line: 13; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Send seek event to change rate */
|
||||
static void send_seek_event (CustomData *data) {
|
||||
gint64 position;
|
||||
|
@ -312,7 +312,7 @@ want to move, we jump to the current position. Using a Step Event would
|
|||
be simpler, but this event is not currently fully functional, as
|
||||
explained in the Introduction.
|
||||
|
||||
``` first-line: 25; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Create the seek event */
|
||||
if (data->rate > 0) {
|
||||
seek_event = gst_event_new_seek (data->rate, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE,
|
||||
|
@ -329,7 +329,7 @@ position. Regardless of the playback direction, the start position must
|
|||
be smaller than the stop position, so the two playback directions are
|
||||
treated differently.
|
||||
|
||||
``` first-line: 34; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
if (data->video_sink == NULL) {
|
||||
/* If we have not done so, obtain the sink through which we will send the seek events */
|
||||
g_object_get (data->pipeline, "video-sink", &data->video_sink, NULL);
|
||||
|
@ -343,7 +343,7 @@ at this time instead at initialization time because the actual sink may
|
|||
change depending on the media contents, and this won’t be known until
|
||||
the pipeline is PLAYING and some media has been read.
|
||||
|
||||
``` first-line: 39; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Send the event */
|
||||
gst_element_send_event (data->video_sink, seek_event);
|
||||
```
|
||||
|
@ -354,7 +354,7 @@ The new Event is finally sent to the selected sink with
|
|||
Back to the keyboard handler, we still miss the frame stepping code,
|
||||
which is really simple:
|
||||
|
||||
``` first-line: 71; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
case 'n':
|
||||
if (data->video_sink == NULL) {
|
||||
/* If we have not done so, obtain the sink through which we will send the step events */
|
||||
|
@ -406,4 +406,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
[vs2010.zip](attachments/327800/2424884.zip) (application/zip)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Basic tutorial 14: Handy elements
|
||||
# Basic tutorial 14: Handy elements
|
||||
|
||||
This page last changed on May 13, 2014 by xartigas.
|
||||
|
||||
|
@ -37,11 +37,11 @@ a `decodebin2` element. It acts like a demuxer, so it offers as many
|
|||
source pads as streams are found in the
|
||||
media.
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
gst-launch-0.10 uridecodebin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm ! ffmpegcolorspace ! autovideosink
|
||||
```
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
gst-launch-0.10 uridecodebin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm ! audioconvert ! autoaudiosink
|
||||
```
|
||||
|
||||
|
@ -55,7 +55,7 @@ replaces the old `decodebin` element. It acts like a demuxer, so it
|
|||
offers as many source pads as streams are found in the
|
||||
media.
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
gst-launch-0.10 souphttpsrc location=http://docs.gstreamer.com/media/sintel_trailer-480p.webm ! decodebin2 ! autovideosink
|
||||
```
|
||||
|
||||
|
@ -69,7 +69,7 @@ using a `typefind` element or by setting the `typefind` property
|
|||
of `filesrc` to
|
||||
`TRUE`.
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: false
|
||||
``` lang=c
|
||||
gst-launch-0.10 filesrc location=f:\\media\\sintel\\sintel_trailer-480p.webm ! decodebin2 ! autovideosink
|
||||
```
|
||||
|
||||
|
@ -79,7 +79,7 @@ This element writes to a file all the media it receives. Use the
|
|||
`location` property to specify the file
|
||||
name.
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10 audiotestsrc ! vorbisenc ! oggmux ! filesink location=test.ogg
|
||||
```
|
||||
|
||||
|
@ -91,7 +91,7 @@ This element receives data as a client over the network via HTTP using
|
|||
the SOUP library. Set the URL to retrieve through the `location`
|
||||
property.
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
gst-launch-0.10 souphttpsrc location=http://docs.gstreamer.com/media/sintel_trailer-480p.webm ! decodebin2 ! autovideosink
|
||||
```
|
||||
|
||||
|
@ -106,7 +106,7 @@ are “guaranteed” to work.
|
|||
This element produces a video pattern (selectable among many different
|
||||
options with the `pattern` property). Use it to test video pipelines.
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
gst-launch-0.10 videotestsrc ! ffmpegcolorspace ! autovideosink
|
||||
```
|
||||
|
||||
|
@ -115,7 +115,7 @@ gst-launch-0.10 videotestsrc ! ffmpegcolorspace ! autovideosink
|
|||
This element produces an audio wave (selectable among many different
|
||||
options with the `wave` property). Use it to test video pipelines.
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
gst-launch-0.10 audiotestsrc ! audioconvert ! autoaudiosink
|
||||
```
|
||||
|
||||
|
@ -137,7 +137,7 @@ elements whose Caps are unknown at design time, like `autovideosink`, or
|
|||
that can vary depending on external factors, like decoding a
|
||||
user-provided file.
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
gst-launch-0.10 videotestsrc ! ffmpegcolorspace ! autovideosink
|
||||
```
|
||||
|
||||
|
@ -157,7 +157,7 @@ It is therefore a good idea to always use it whenever the actual frame
|
|||
rate is unknown at design time, just in
|
||||
case.
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: false
|
||||
``` lang=c
|
||||
gst-launch-0.10 videotestsrc ! video/x-raw-rgb,framerate=30/1 ! videorate ! video/x-raw-rgb,framerate=1/1 ! ffmpegcolorspace ! autovideosink
|
||||
```
|
||||
|
||||
|
@ -178,7 +178,7 @@ user, it is a good idea to use a `videoscale` element, since not all
|
|||
video sinks are capable of performing scaling
|
||||
operations.
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
gst-launch-0.10 uridecodebin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm ! videoscale ! video/x-raw-yuv,width=178,height=100 ! ffmpegcolorspace ! autovideosink
|
||||
```
|
||||
|
||||
|
@ -195,7 +195,7 @@ Like `ffmpegcolorspace` does for video, you use this to solve
|
|||
negotiation problems with audio, and it is generally safe to use it
|
||||
liberally, since this element does nothing if it is not needed.
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
gst-launch-0.10 audiotestsrc ! audioconvert ! autoaudiosink
|
||||
```
|
||||
|
||||
|
@ -208,7 +208,7 @@ Again, use it to solve negotiation problems regarding sampling rates and
|
|||
do not fear to use it
|
||||
generously.
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
gst-launch-0.10 uridecodebin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm ! audioresample ! audio/x-raw-float,rate=4000 ! audioconvert ! autoaudiosink
|
||||
```
|
||||
|
||||
|
@ -295,7 +295,7 @@ separate threads for each branch. Otherwise a blocked dataflow in one
|
|||
branch would stall the other
|
||||
branches.
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10 audiotestsrc ! tee name=t ! queue ! audioconvert ! autoaudiosink t. ! queue ! wavescope ! ffmpegcolorspace ! autovideosink
|
||||
```
|
||||
|
||||
|
@ -311,7 +311,7 @@ the `capsfilter` element. This element does not modify data as such,
|
|||
but enforces limitations on the data
|
||||
format.
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
gst-launch-0.10 videotestsrc ! video/x-raw-gray ! ffmpegcolorspace ! autovideosink
|
||||
```
|
||||
|
||||
|
@ -338,7 +338,7 @@ equation. It can be very verbose when combined with the `-v` switch
|
|||
of `gst-launch`, so use the `silent` property to remove any unwanted
|
||||
noise.
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10 audiotestsrc num-buffers=1000 ! fakesink sync=false
|
||||
```
|
||||
|
||||
|
@ -350,7 +350,7 @@ checking, or buffer dropping. Read its documentation to learn all the
|
|||
things this seemingly harmless element can
|
||||
do.
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-launch-0.10 audiotestsrc ! identity drop-probability=0.1 ! audioconvert ! autoaudiosink
|
||||
```
|
||||
|
||||
|
@ -364,4 +364,3 @@ debugging purposes.
|
|||
It has been a pleasure having you here, and see you soon\!
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Basic tutorial 15: Clutter integration
|
||||
# Basic tutorial 15: Clutter integration
|
||||
|
||||
This page last changed on Jul 11, 2012 by xartigas.
|
||||
|
||||
|
@ -36,7 +36,7 @@ Copy this code into a text file named `basic-tutorial-15.c`..
|
|||
|
||||
**basic-tutorial-15.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <clutter-gst/clutter-gst.h>
|
||||
|
||||
/* Setup the video texture once its size is known */
|
||||
|
@ -165,7 +165,7 @@ how to integrate GStreamer with it. This is accomplished through the
|
|||
clutter-gst library, so its header must be included (and the program
|
||||
must link against it):
|
||||
|
||||
``` first-line: 1; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <clutter-gst/clutter-gst.h>
|
||||
```
|
||||
|
||||
|
@ -173,7 +173,7 @@ The first thing this library does is initialize both GStreamer and
|
|||
Clutter, so you must call ` clutter-gst-init()` instead of initializing
|
||||
these libraries yourself.
|
||||
|
||||
``` first-line: 43; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* clutter-gst takes care of initializing Clutter and GStreamer */
|
||||
if (clutter_gst_init (&argc, &argv) != CLUTTER_INIT_SUCCESS) {
|
||||
g_error ("Failed to initialize clutter\n");
|
||||
|
@ -186,7 +186,7 @@ create a texture. Just remember to disable texture slicing to allow for
|
|||
proper
|
||||
integration:
|
||||
|
||||
``` first-line: 55; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Create new texture and disable slicing so the video is properly mapped onto it */
|
||||
texture = CLUTTER_ACTOR (g_object_new (CLUTTER_TYPE_TEXTURE, "disable-slicing", TRUE, NULL));
|
||||
g_signal_connect (texture, "size-change", G_CALLBACK (size_change), NULL);
|
||||
|
@ -195,7 +195,7 @@ g_signal_connect (texture, "size-change", G_CALLBACK (size_change), NULL);
|
|||
We connect to the size-change signal so we can perform final setup once
|
||||
the video size is known.
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Instantiate the Clutter sink */
|
||||
sink = gst_element_factory_make ("autocluttersink", NULL);
|
||||
if (sink == NULL) {
|
||||
|
@ -216,14 +216,14 @@ release of the SDK, so, if it cannot be found, the
|
|||
simpler `cluttersink` element is created
|
||||
instead.
|
||||
|
||||
``` first-line: 73; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Link GStreamer with Clutter by passing the Clutter texture to the Clutter sink*/
|
||||
g_object_set (sink, "texture", texture, NULL);
|
||||
```
|
||||
|
||||
This texture is everything GStreamer needs to know about Clutter.
|
||||
|
||||
``` first-line: 76; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Add the Clutter sink to the pipeline */
|
||||
g_object_set (pipeline, "video-sink", sink, NULL);
|
||||
```
|
||||
|
@ -252,4 +252,3 @@ This tutorial has shown:
|
|||
It has been a pleasure having you here, and see you soon\!
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Basic tutorial 16: Platform-specific elements
|
||||
# Basic tutorial 16: Platform-specific elements
|
||||
|
||||
This page last changed on May 30, 2013 by xartigas.
|
||||
|
||||
|
@ -209,4 +209,3 @@ instancing them manually.
|
|||
It has been a pleasure having you here, and see you soon\!
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -101,7 +101,6 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
```
|
||||
|
||||
|
||||
> ![Information](images/icons/emoticons/information.png)
|
||||
> Need help?
|
||||
>
|
||||
|
|
|
@ -237,7 +237,6 @@ exit:
|
|||
}
|
||||
```
|
||||
|
||||
|
||||
> ![Information](images/icons/emoticons/information.png)
|
||||
> Need help?
|
||||
>
|
||||
|
|
|
@ -35,7 +35,7 @@ in the SDK installation).
|
|||
|
||||
**basic-tutorial-4.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <gst/gst.h>
|
||||
|
||||
/* Structure to contain all our information, so we can pass it around */
|
||||
|
@ -414,7 +414,6 @@ if (data->playing) {
|
|||
}
|
||||
```
|
||||
|
||||
|
||||
`gst_query_new_seeking()` creates a new query object of the "seeking"
|
||||
type, with `GST_FORMAT_TIME` format. This indicates that we are
|
||||
interested in seeking by specifying the new time to which we want to
|
||||
|
@ -455,4 +454,3 @@ Remember that attached to this page you should find the complete source
|
|||
code of the tutorial and any accessory files needed to build it.
|
||||
|
||||
It has been a pleasure having you here, and see you soon!
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ rendering.
|
|||
>
|
||||
> A GObject *interface* (which GStreamer uses) is a set of functions that an element can implement. If it does, then it is said to support that particular interface. For example, video sinks usually create their own windows to display video, but, if they are also capable of rendering to an external window, they can choose to implement the `GstVideoOverlay` interface and provide functions to specify this external window. From the application developer point of view, if a certain interface is supported, you can use it and forget about which kind of element is implementing it. Moreover, if you are using `playbin`, it will automatically expose some of the interfaces supported by its internal elements: You can use your interface functions directly on `playbin` without knowing who is implementing them!
|
||||
|
||||
|
||||
Another issue is that GUI toolkits usually only allow manipulation of
|
||||
the graphical “widgets” through the main (or application) thread,
|
||||
whereas GStreamer usually spawns multiple threads to take care of
|
||||
|
@ -886,5 +885,3 @@ The following basic tutorials keep focusing on other individual
|
|||
GStreamer topics
|
||||
|
||||
It has been a pleasure having you here, and see you soon!
|
||||
|
||||
|
||||
|
|
|
@ -332,7 +332,6 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
```
|
||||
|
||||
|
||||
> ![Information](images/icons/emoticons/information.png)
|
||||
> Need help?
|
||||
>
|
||||
|
@ -475,4 +474,3 @@ from the GStreamer pipeline.
|
|||
Remember that attached to this page you should find the complete source
|
||||
code of the tutorial and any accessory files needed to build it.
|
||||
It has been a pleasure having you here, and see you soon!
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ in the SDK installation).
|
|||
|
||||
**basic-tutorial-7.c**
|
||||
|
||||
```
|
||||
``` lang=c
|
||||
#include <gst/gst.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
@ -330,5 +330,3 @@ The next tutorial builds on top of this one to show how data can be
|
|||
manually injected into and extracted from a running pipeline.
|
||||
|
||||
It has been a pleasure having you here, and see you soon!
|
||||
|
||||
|
||||
|
|
|
@ -355,7 +355,7 @@ Always Pads, and manually link the Request Pads of the `tee` element.
|
|||
|
||||
Regarding the configuration of the `appsrc` and `appsink` elements:
|
||||
|
||||
```
|
||||
``` lang=c
|
||||
/* Configure appsrc */
|
||||
audio_caps_text = g_strdup_printf (AUDIO_CAPS, SAMPLE_RATE);
|
||||
audio_caps = gst_caps_from_string (audio_caps_text);
|
||||
|
@ -376,7 +376,7 @@ fired by `appsrc` when its internal queue of data is running low or
|
|||
almost full, respectively. We will use these signals to start and stop
|
||||
(respectively) our signal generation process.
|
||||
|
||||
```
|
||||
``` lang=c
|
||||
/* Configure appsink */
|
||||
g_object_set (data.app_sink, "emit-signals", TRUE, "caps", audio_caps, NULL);
|
||||
g_signal_connect (data.app_sink, "new-sample", G_CALLBACK (new_sample), &data);
|
||||
|
@ -393,7 +393,7 @@ Starting the pipeline, waiting for messages and final cleanup is done as
|
|||
usual. Let's review the callbacks we have just
|
||||
registered:
|
||||
|
||||
```
|
||||
``` lang=c
|
||||
/* This signal callback triggers when appsrc needs data. Here, we add an idle handler
|
||||
* to the mainloop to start pushing data into the appsrc */
|
||||
static void start_feed (GstElement *source, guint size, CustomData *data) {
|
||||
|
@ -422,7 +422,7 @@ We take note of the sourceid that `g_idle_add()` returns, so we can
|
|||
disable it
|
||||
later.
|
||||
|
||||
```
|
||||
``` lang=c
|
||||
/* This callback triggers when appsrc has enough data and we can stop sending.
|
||||
* We remove the idle handler from the mainloop */
|
||||
static void stop_feed (GstElement *source, CustomData *data) {
|
||||
|
@ -439,7 +439,7 @@ enough so we stop pushing data. Here we simply remove the idle function
|
|||
by using `g_source_remove()` (The idle function is implemented as a
|
||||
`GSource`).
|
||||
|
||||
```
|
||||
``` lang=c
|
||||
/* This method is called by the idle GSource in the mainloop, to feed CHUNK_SIZE bytes into appsrc.
|
||||
* The ide handler is added to the mainloop when appsrc requests us to start sending data (need-data signal)
|
||||
* and is removed when appsrc has enough data (enough-data signal).
|
||||
|
@ -489,7 +489,7 @@ We will skip over the waveform generation, since it is outside the scope
|
|||
of this tutorial (it is simply a funny way of generating a pretty
|
||||
psychedelic wave).
|
||||
|
||||
```
|
||||
``` lang=c
|
||||
/* Push the buffer into the appsrc */
|
||||
g_signal_emit_by_name (data->app_source, "push-buffer", buffer, &ret);
|
||||
|
||||
|
@ -503,11 +503,10 @@ tutorial 1: Playbin2
|
|||
usage](Playback+tutorial+1+Playbin2+usage.markdown)), and then
|
||||
`gst_buffer_unref()` it since we no longer need it.
|
||||
|
||||
```
|
||||
``` lang=c
|
||||
/* The appsink has received a buffer */
|
||||
static void new_sample (GstElement *sink, CustomData *data) {
|
||||
GstSample *sample;
|
||||
|
||||
/* Retrieve the buffer */
|
||||
g_signal_emit_by_name (sink, "pull-sample", &sample);
|
||||
if (sample) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Basic tutorial 9: Media information gathering
|
||||
# Basic tutorial 9: Media information gathering
|
||||
|
||||
This page last changed on May 30, 2012 by xartigas.
|
||||
|
||||
|
@ -81,7 +81,7 @@ in the SDK installation).
|
|||
|
||||
**basic-tutorial-9.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <string.h>
|
||||
#include <gst/gst.h>
|
||||
#include <gst/pbutils/pbutils.h>
|
||||
|
@ -328,7 +328,7 @@ int main (int argc, char **argv) {
|
|||
|
||||
These are the main steps to use the `GstDiscoverer`:
|
||||
|
||||
``` first-line: 182; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Instantiate the Discoverer */
|
||||
data.discoverer = gst_discoverer_new (5 * GST_SECOND, &err);
|
||||
if (!data.discoverer) {
|
||||
|
@ -342,7 +342,7 @@ if (!data.discoverer) {
|
|||
parameter is the timeout per file, in nanoseconds (use the
|
||||
`GST_SECOND` macro for simplicity).
|
||||
|
||||
``` first-line: 190; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Connect to the interesting signals */
|
||||
g_signal_connect (data.discoverer, "discovered", G_CALLBACK (on_discovered_cb), &data);
|
||||
g_signal_connect (data.discoverer, "finished", G_CALLBACK (on_finished_cb), &data);
|
||||
|
@ -351,7 +351,7 @@ g_signal_connect (data.discoverer, "finished", G_CALLBACK (on_finished_cb), &dat
|
|||
Connect to the interesting signals, as usual. We discuss them in the
|
||||
snippet for their callbacks.
|
||||
|
||||
``` first-line: 194; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Start the discoverer process (nothing to do yet) */
|
||||
gst_discoverer_start (data.discoverer);
|
||||
```
|
||||
|
@ -360,7 +360,7 @@ gst_discoverer_start (data.discoverer);
|
|||
not provided any URI to discover yet. This is done
|
||||
next:
|
||||
|
||||
``` first-line: 197; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Add a request to process asynchronously the URI passed through the command line */
|
||||
if (!gst_discoverer_discover_uri_async (data.discoverer, uri)) {
|
||||
g_print ("Failed to start discovering URI '%s'\n", uri);
|
||||
|
@ -375,7 +375,7 @@ discovery process for each of them finishes, the registered callback
|
|||
functions will be fired
|
||||
up.
|
||||
|
||||
``` first-line: 204; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Create a GLib Main Loop and set it to run, so we can wait for the signals */
|
||||
data.loop = g_main_loop_new (NULL, FALSE);
|
||||
g_main_loop_run (data.loop);
|
||||
|
@ -385,7 +385,7 @@ The usual GLib main loop is instantiated and executed. We will get out
|
|||
of it when `g_main_loop_quit()` is called from the
|
||||
`on_finished_cb` callback.
|
||||
|
||||
``` first-line: 208; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Stop the discoverer process */
|
||||
gst_discoverer_stop (data.discoverer);
|
||||
```
|
||||
|
@ -396,7 +396,7 @@ Once we are done with the discoverer, we stop it with
|
|||
Let's review now the callbacks we have
|
||||
registered:
|
||||
|
||||
``` first-line: 85; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* This function is called every time the discoverer has information regarding
|
||||
* one of the URIs we provided.*/
|
||||
static void on_discovered_cb (GstDiscoverer *discoverer, GstDiscovererInfo *info, GError *err, CustomData *data) {
|
||||
|
@ -417,7 +417,7 @@ case we had multiple discover process running, which is not the case in
|
|||
this example) with `gst_discoverer_info_get_uri()` and the discovery
|
||||
result with `gst_discoverer_info_get_result()`.
|
||||
|
||||
``` first-line: 95; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
switch (result) {
|
||||
case GST_DISCOVERER_URI_INVALID:
|
||||
g_print ("Invalid URI '%s'\n", uri);
|
||||
|
@ -447,7 +447,6 @@ switch (result) {
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
if (result != GST_DISCOVERER_OK) {
|
||||
g_printerr ("This URI cannot be played\n");
|
||||
return;
|
||||
|
@ -468,7 +467,7 @@ If no error happened, information can be retrieved from the
|
|||
Bits of information which are made of lists, like tags and stream info,
|
||||
needs some extra parsing:
|
||||
|
||||
``` first-line: 133; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
tags = gst_discoverer_info_get_tags (info);
|
||||
if (tags) {
|
||||
g_print ("Tags:\n");
|
||||
|
@ -483,7 +482,7 @@ or a specific tag could be searched for with
|
|||
`gst_tag_list_get_string()`). The code for `print_tag_foreach` is pretty
|
||||
much self-explicative.
|
||||
|
||||
``` first-line: 143; theme: Default; brush: cpp; gutter: false
|
||||
``` lang=c
|
||||
sinfo = gst_discoverer_info_get_stream_info (info);
|
||||
if (!sinfo)
|
||||
return;
|
||||
|
@ -500,7 +499,7 @@ a `GstDiscovererStreamInfo` structure that is parsed in
|
|||
the `print_topology` function, and then discarded
|
||||
with `gst_discoverer_stream_info_unref()`.
|
||||
|
||||
``` first-line: 60; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Print information regarding a stream and its substreams, if any */
|
||||
static void print_topology (GstDiscovererStreamInfo *info, gint depth) {
|
||||
GstDiscovererStreamInfo *next;
|
||||
|
@ -551,4 +550,3 @@ This tutorial has shown:
|
|||
It has been a pleasure having you here, and see you soon\!
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -4,4 +4,3 @@
|
|||
|
||||
These tutorials describe general topics required to understand the rest
|
||||
of tutorials in the GStreamer SDK.
|
||||
|
||||
|
|
|
@ -1,55 +1,70 @@
|
|||
# Building from source using Cerbero
|
||||
# Building from source using Cerbero
|
||||
|
||||
> ![Warning](images/icons/emoticons/warning.png)
|
||||
> This section is intended for advanced users.</p></td>
|
||||
> ![Warning] This section is intended for advanced users.
|
||||
> </p>
|
||||
> </td>
|
||||
|
||||
## Build requirements
|
||||
|
||||
The GStreamer SDK build system provides bootstrapping facilities for all
|
||||
platforms, but it still needs a minimum base to bootstrap:
|
||||
|
||||
- python \>= 2.6 and python's `argparse` module, which is already
|
||||
- python >= 2.6 and python's `argparse` module, which is already
|
||||
included in python2.7.
|
||||
- git
|
||||
- git
|
||||
|
||||
> ![Information](images/icons/emoticons/information.png)
|
||||
> **Windows users**
|
||||
>
|
||||
> Cerbero can be used on Windows using the Msys/MinGW shell (a Unix-like shell for Windows). There is a bit of setup that you need to do before Cerbero can take control.
|
||||
>
|
||||
> You need to install the following programs:
|
||||
> - [Python 2.7](http://www.python.org/getit/releases/2.7/)
|
||||
> - [Git](http://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git) (Select the install option "Checkout as-is, Commit as-is" and install it in a path without spaces, eg: c:\Git)
|
||||
> - [Msys/MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/) (Install it with all the options enabled)
|
||||
> - [CMake](http://www.cmake.org/cmake/resources/software.htm) (Select the option "Add CMake in system path for the current user")
|
||||
> - [Yasm](http://yasm.tortall.net/Download.html) (Download the win32 or win64 version for your platform, name it <code>yasm.exe</code>, and place it in your MinGW <code>bin</code> directory, typically, <code>C:\MinGW\bin</code>)
|
||||
> - [WiX 3.5](http://wix.codeplex.com/releases/view/60102)
|
||||
> - [Microsoft SDK 7.1](http://www.microsoft.com/en-us/download/details.aspx?id=8279) (Install the SDK samples and the Visual C++ Compilers, required to build the DirectShow base classes. Might need installing the .NET 4 Framework first if the SDK installer doesn't find it)
|
||||
> - [Windows Driver Kit 7.1.0](http://msdn.microsoft.com/en-us/windows/hardware/hh852365)
|
||||
>
|
||||
> Your user ID can't have spaces (eg: John Smith). Paths with spaces are not correctly handled in the build system and msys uses the user ID for the home folder.
|
||||
>
|
||||
>Cerbero must be run in the MinGW shell, which is accessible from the main menu once MinGW is installed.
|
||||
>
|
||||
>The last step is making `python` and `git` available from the shell, for which you will need to create a `.profile` file. Issue this command from within the MinGW shell:
|
||||
>
|
||||
> `echo "export PATH=\"\$PATH:/c/Python27:/c/Git/bin\"" >> ~/.profile`
|
||||
>
|
||||
> Using the appropriate paths to where you installed `python` and `git`
|
||||
>
|
||||
> (Note that inside the shell, / is mapped to c:\Mingw\msys\1.0\ )
|
||||
### Windows users
|
||||
|
||||
Cerbero can be used on Windows using the Msys/MinGW shell (a Unix-like
|
||||
shell for Windows). There is a bit of setup that you need to do before
|
||||
Cerbero can take control.
|
||||
|
||||
> ![Information](images/icons/emoticons/information.png)
|
||||
> **OS X users**
|
||||
>
|
||||
>To use cerbero on OS X you need to install the "Command Line Tools" from XCode. They are available from the "Preferences" dialog under "Downloads".
|
||||
You need to install the following programs:
|
||||
|
||||
- [Python 2.7]
|
||||
- [Git] (Select the install option "Checkout as-is, Commit as-is" and
|
||||
install it in a path without spaces, eg: c:\Git)
|
||||
- [Msys/MinGW] (Install it with all the options enabled)
|
||||
- [CMake] (Select the option "Add CMake in system path for the
|
||||
current user")
|
||||
- [Yasm] (Download the win32 or win64 version for your platform, name
|
||||
it `yasm.exe`, and place it in your MinGW `bin` directory,
|
||||
typically, `C:\MinGW\bin`)
|
||||
- [WiX 3.5]
|
||||
- [Microsoft SDK 7.1] (Install the SDK samples and the Visual C++
|
||||
Compilers, required to build the DirectShow base classes. Might need
|
||||
installing the .NET 4 Framework first if the SDK installer doesn't
|
||||
find it)
|
||||
- [Windows Driver Kit 7.1.0]
|
||||
|
||||
> ![Information](images/icons/emoticons/information.png)
|
||||
> **iOS developers**
|
||||
>
|
||||
>If you want to build the GStreamer-SDK for iOS, you also need the iOS SDK. The minimum required iOS SDK version is 6.0 and is included in [XCode](https://developer.apple.com/devcenter/ios/index.action#downloads) since version 4.
|
||||
Your user ID can't have spaces (eg: John Smith). Paths with spaces are
|
||||
not correctly handled in the build system and msys uses the user ID for
|
||||
the home folder.
|
||||
|
||||
Cerbero must be run in the MinGW shell, which is accessible from the
|
||||
main menu once MinGW is installed.
|
||||
|
||||
The last step is making `python` and `git` available from the shell, for
|
||||
which you will need to create a `.profile` file. Issue this command from
|
||||
within the MinGW shell:
|
||||
|
||||
`echo "export PATH=\"\$PATH:/c/Python27:/c/Git/bin\"" >> ~/.profile`
|
||||
|
||||
Using the appropriate paths to where you installed `python` and `git`
|
||||
|
||||
(Note that inside the shell, / is mapped to c:\Mingw\msys\1.0 )
|
||||
|
||||
### OS X users
|
||||
|
||||
To use cerbero on OS X you need to install the "Command Line Tools" from
|
||||
XCode. They are available from the "Preferences" dialog under
|
||||
"Downloads".
|
||||
|
||||
### iOS developers
|
||||
|
||||
If you want to build the GStreamer-SDK for iOS, you also need the iOS
|
||||
SDK. The minimum required iOS SDK version is 6.0 and is included in
|
||||
[XCode] since version 4.
|
||||
|
||||
## Download the sources
|
||||
|
||||
|
@ -60,18 +75,14 @@ architectures and distributions.
|
|||
|
||||
Get a copy of Cerbero by cloning the git repository:
|
||||
|
||||
```
|
||||
git clone git://anongit.freedesktop.org/gstreamer/cerbero
|
||||
```
|
||||
git clone git://anongit.freedesktop.org/gstreamer/cerbero
|
||||
|
||||
Cerbero can be run uninstalled and for convenience you can create an
|
||||
alias in your `.bashrc` file*. *If you prefer to skip this step,
|
||||
remember that you need to replace the calls to `cerbero` with
|
||||
`./cerbero-uninstalled` in the next steps.
|
||||
|
||||
```
|
||||
echo "alias cerbero='~/git/cerbero/cerbero-uninstalled'" >> ~/.bashrc
|
||||
```
|
||||
echo "alias cerbero='~/git/cerbero/cerbero-uninstalled'" >> ~/.bashrc
|
||||
|
||||
## Setup environment
|
||||
|
||||
|
@ -87,15 +98,12 @@ are running and will use default build options such as the default build
|
|||
directory. The default options should work fine on the supported
|
||||
distributions.
|
||||
|
||||
An example configuration file with detailed comments can be found
|
||||
[here](http://www.freedesktop.org/software/gstreamer-sdk/cerbero.cbc.template)
|
||||
An example configuration file with detailed comments can be found [here]
|
||||
|
||||
To fire up the bootstrapping process, go to the directory where you
|
||||
cloned/unpacked Cerbero and type:
|
||||
|
||||
```
|
||||
cerbero bootstrap
|
||||
```
|
||||
cerbero bootstrap
|
||||
|
||||
Enter the superuser/root password when prompted.
|
||||
|
||||
|
@ -106,45 +114,33 @@ the GStreamer SDK.
|
|||
|
||||
To generate the SDK, use the following command:
|
||||
|
||||
```
|
||||
cerbero package gstreamer-1.0
|
||||
```
|
||||
cerbero package gstreamer-1.0
|
||||
|
||||
This should build all required SDK components and create packages for
|
||||
your distribution at the Cerbero source directory.
|
||||
|
||||
A list of supported packages to build can be retrieved using:
|
||||
|
||||
```
|
||||
cerbero list-packages
|
||||
```
|
||||
cerbero list-packages
|
||||
|
||||
Packages are composed of 0 (in case of a meta package) or more
|
||||
components that can be built separately if desired. The components are
|
||||
defined as individual recipes and can be listed with:
|
||||
|
||||
```
|
||||
cerbero list
|
||||
```
|
||||
cerbero list
|
||||
|
||||
To build an individual recipe and its dependencies, do the following:
|
||||
|
||||
```
|
||||
cerbero build <recipe_name>
|
||||
```
|
||||
cerbero build <recipe_name>
|
||||
|
||||
Or to build or force a rebuild of a recipe without building its
|
||||
dependencies use:
|
||||
|
||||
```
|
||||
cerbero buildone <recipe_name>
|
||||
```
|
||||
cerbero buildone <recipe_name>
|
||||
|
||||
To wipe everything and start from scratch:
|
||||
|
||||
```
|
||||
cerbero wipe
|
||||
```
|
||||
cerbero wipe
|
||||
|
||||
Once built, the output of the recipes will be installed at the prefix
|
||||
defined in the Cerbero configuration file `$HOME/.cerbero/cerbero.cbc`
|
||||
|
@ -157,53 +153,43 @@ can be very slow on Windows, so if you only need to rebuild a single
|
|||
project (eg: gst-plugins-good to patch qtdemux) there is a much faster
|
||||
way of doing it. You will need to follow the steps detailed in this
|
||||
page, but skipping the step "**Build the SDK**", and installing the
|
||||
SDK's development files as explained in [Installing the
|
||||
SDK](Installing+the+SDK.markdown).
|
||||
SDK's development files as explained in [Installing the SDK].
|
||||
|
||||
By default, Cerbero uses as prefix a folder in the user directory with
|
||||
the following schema ~/cerbero/dist/$platform\_$arch, but for the SDK we
|
||||
must change this prefix to use its installation directory. This can be
|
||||
done with a custom configuration file named *custom.cbc*:
|
||||
the following schema \~/cerbero/dist/$platform\_$arch, but for the SDK
|
||||
we must change this prefix to use its installation directory. This can
|
||||
be done with a custom configuration file named *custom.cbc*:
|
||||
|
||||
```
|
||||
# For Windows x86
|
||||
prefix='/c/gstreamer/1.0/x86/'
|
||||
# For Windows x86
|
||||
prefix='/c/gstreamer/1.0/x86/'
|
||||
|
||||
# For Windows x86_64
|
||||
#prefix='/c/gstreamer/1.0/x86_64'
|
||||
# For Windows x86_64
|
||||
#prefix='/c/gstreamer/1.0/x86_64'
|
||||
|
||||
# For Linux
|
||||
#prefix='/opt/gstreamer'
|
||||
# For Linux
|
||||
#prefix='/opt/gstreamer'
|
||||
|
||||
# For OS X
|
||||
#prefix='/Library/Frameworks/GStreamer.framework/Versions/1.0'
|
||||
```
|
||||
# For OS X
|
||||
#prefix='/Library/Frameworks/GStreamer.framework/Versions/1.0'
|
||||
|
||||
The prefix path might not be writable by your current user. Make sure
|
||||
you fix it before, for instance with:
|
||||
|
||||
```
|
||||
$ sudo chown -R <username> /Library/Frameworks/GStreamer.framework/
|
||||
```
|
||||
$ sudo chown -R <username> /Library/Frameworks/GStreamer.framework/
|
||||
|
||||
Cerbero has a shell command that starts a new shell with all the
|
||||
environment set up to target the SDK. You can start a new shell using
|
||||
the installation prefix defined in *custom.cbc *with the following
|
||||
command:
|
||||
|
||||
```
|
||||
$ cerbero -c custom.cbc shell
|
||||
```
|
||||
$ cerbero -c custom.cbc shell
|
||||
|
||||
Once you are in Cerbero's shell you can compile new
|
||||
projects targeting the SDK using the regular build
|
||||
process:
|
||||
Once you are in Cerbero's shell you can compile new projects targeting
|
||||
the SDK using the regular build process:
|
||||
|
||||
```
|
||||
$ git clone -b sdk-0.10.31 git://anongit.freedesktop.org/gstreamer-sdk/gst-plugins-good; cd gst-plugins-good
|
||||
$ sh autogen.sh --disable-gtk-doc --prefix=<prefix>
|
||||
$ make -C gst/isomp4
|
||||
```
|
||||
$ git clone -b sdk-0.10.31 git://anongit.freedesktop.org/gstreamer-sdk/gst-plugins-good; cd gst-plugins-good
|
||||
$ sh autogen.sh --disable-gtk-doc --prefix=<prefix>
|
||||
$ make -C gst/isomp4
|
||||
|
||||
### Cross-compilation of the SDK
|
||||
|
||||
|
@ -219,9 +205,7 @@ You can cross-compile the SDK for Android from a Linux host using the
|
|||
configuration file `config/cross-android.cbc`. Replace all the previous
|
||||
commands with:
|
||||
|
||||
```
|
||||
cerbero -c config/cross-android.cbc <command>
|
||||
```
|
||||
cerbero -c config/cross-android.cbc <command>
|
||||
|
||||
#### Windows
|
||||
|
||||
|
@ -232,21 +216,28 @@ only be created from Windows.
|
|||
|
||||
Replace all the above commands for Windows 32bits with:
|
||||
|
||||
```
|
||||
cerbero -c config/cross-win32.cbc <command>
|
||||
```
|
||||
cerbero -c config/cross-win32.cbc <command>
|
||||
|
||||
Or with using the following for Windows 64bits:
|
||||
|
||||
```
|
||||
cerbero -c config/cross-win64.cbc <command>
|
||||
```
|
||||
cerbero -c config/cross-win64.cbc <command>
|
||||
|
||||
#### iOS
|
||||
|
||||
To cross compile for iOS from OS X, use the configuration file
|
||||
`config/cross-ios-universal.cbc`. Replace all previous commands with:
|
||||
|
||||
```
|
||||
cerbero -c config/cross-ios-universal.cbc <command>
|
||||
```
|
||||
cerbero -c config/cross-ios-universal.cbc <command>
|
||||
|
||||
[Warning]: images/icons/emoticons/warning.png
|
||||
[Python 2.7]: http://www.python.org/getit/releases/2.7/
|
||||
[Git]: http://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git
|
||||
[Msys/MinGW]: https://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/
|
||||
[CMake]: http://www.cmake.org/cmake/resources/software.htm
|
||||
[Yasm]: http://yasm.tortall.net/Download.html
|
||||
[WiX 3.5]: http://wix.codeplex.com/releases/view/60102
|
||||
[Microsoft SDK 7.1]: http://www.microsoft.com/en-us/download/details.aspx?id=8279
|
||||
[Windows Driver Kit 7.1.0]: http://msdn.microsoft.com/en-us/windows/hardware/hh852365
|
||||
[XCode]: https://developer.apple.com/devcenter/ios/index.action#downloads
|
||||
[here]: http://www.freedesktop.org/software/gstreamer-sdk/cerbero.cbc.template
|
||||
[Installing the SDK]: Installing+the+SDK.markdown
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Contact
|
||||
# Contact
|
||||
|
||||
This page last changed on Dec 03, 2012 by xartigas.
|
||||
|
||||
|
@ -35,4 +35,3 @@ We want to hear from you!</p></td>
|
|||
</table>
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:28
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Deploying your application
|
||||
# Deploying your application
|
||||
|
||||
This page last changed on Jun 12, 2013 by xartigas.
|
||||
|
||||
|
@ -128,4 +128,3 @@ options.
|
|||
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Frequently Asked Questions
|
||||
# Frequently Asked Questions
|
||||
|
||||
This page last changed on Jun 12, 2013 by xartigas.
|
||||
|
||||
|
@ -154,4 +154,3 @@ The GStreamer SDK supports the iOS platform since [version 2013.6
|
|||
(Congo)](2013.6%2BCongo.html).
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:28
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : GStreamer reference
|
||||
# GStreamer reference
|
||||
|
||||
This page last changed on Jun 25, 2012 by xartigas.
|
||||
|
||||
|
@ -54,4 +54,3 @@ generated from the source code of GStreamer.
|
|||
</table>
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:28
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK
|
||||
# GStreamer SDK documentation
|
||||
|
||||
## Welcome to the GStreamer SDK documentation!
|
||||
|
||||
|
@ -17,4 +17,3 @@ all about.
|
|||
| [![](attachments/faq.png)](Frequently+Asked+Questions.markdown) | [Frequently Asked Questions](Frequently+Asked+Questions.markdown) |
|
||||
| [![](attachments/legal.png)](Legal+information.markdown) | [Patents, Licenses and legal F.A.Q.](Legal+information.markdown) |
|
||||
| [![](attachments/contact.png)](Contact.markdown) | [Community support, bug reporting...](Contact.markdown) |
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Installing for Android development
|
||||
|
||||
![](images/icons/emoticons/information.png) All versions starting from 2.3.1 Gingerbread are supported
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The development machine is where you will develop your Android
|
||||
|
@ -22,7 +24,6 @@ Optionally, you can use the [Android Studio] (FIX LINK). As stated in the Androi
|
|||
documentation, *developing in Android Studio is highly recommended and
|
||||
is the fastest way to get started*.
|
||||
|
||||
|
||||
Before continuing, make sure you can compile and run the samples
|
||||
included in the Android NDK, and that you understand how the integration
|
||||
of C and Java works via the [Java Native
|
||||
|
@ -34,24 +35,9 @@ here](http://developer.android.com/guide/practices/jni.html).
|
|||
|
||||
## Download and install the SDK
|
||||
|
||||
The SDK has two variants: **Debug** and **Release**. The Debug variant
|
||||
produces lots of debug output and is useful while developing your
|
||||
application. The Release variant is what you will use to produce the
|
||||
final version of your application, since GStreamer code runs slightly
|
||||
faster and the libraries are smaller.
|
||||
|
||||
Get the compressed file below and just unzip it into any folder of your
|
||||
choice (Choose your preferred file format; both files have exactly the
|
||||
same content)
|
||||
|
||||
### Debug variant
|
||||
|
||||
FIXME: Link to download files
|
||||
|
||||
If you intend to build the tutorials in this same folder, make sure you
|
||||
have writing permissions.
|
||||
|
||||
FIXME: Is this all TRUE ?
|
||||
The GStreamer project provides [prebuilt binaries](https://gstreamer.freedesktop.org/data/pkg/android/)
|
||||
you should download the latest version and unzip it into any folder of your
|
||||
choice.
|
||||
|
||||
In the process of building GStreamer-enabled Android applications, some
|
||||
tools will need to know where you installed the SDK. You must define an
|
||||
|
@ -62,10 +48,12 @@ system-wide by adding it to your `~/.profile` file (on Linux and Mac) or
|
|||
to the Environment Variables in the System Properties dialog (on
|
||||
Windows).
|
||||
|
||||
- Point `GSTREAMER_SDK_ROOT_ANDROID` to the folder where you unzipped
|
||||
the SDK.
|
||||
Point `GSTREAMER_SDK_ROOT_ANDROID` to the folder where you unzipped the SDK.
|
||||
|
||||
> ![](images/icons/emoticons/information.png) If you plan to use Eclipse and do not want to define this environment variable globally, you can set it inside Eclipse. Go to Window → Preferences → C/C++ → Build → Build Variables and define `GSTREAMER_SDK_ROOT_ANDROID` there.
|
||||
> ![](images/icons/emoticons/information.png) If you plan to use Android Studio and
|
||||
> do not want to define this environment variable globally, you can set
|
||||
> it inside Eclipse. Go to Window → Preferences → C/C++ → Build → Build Variables
|
||||
> and define `GSTREAMER_SDK_ROOT_ANDROID` there.
|
||||
|
||||
## Configure your development environment
|
||||
|
||||
|
@ -133,7 +121,9 @@ OpenGL ES).
|
|||
|
||||
#### Using the command line
|
||||
|
||||
> ![](images/icons/emoticons/warning.png) Note that, on Windows, this procedure requires a working Cygwin shell, as explained in the [Android NDK System Requirements](http://developer.android.com/tools/sdk/ndk/index.html#Reqs)
|
||||
> ![](images/icons/emoticons/warning.png) Note that, on Windows,
|
||||
> this procedure requires a working Cygwin shell, as explained in
|
||||
> the [Android NDK System Requirements](http://developer.android.com/tools/sdk/ndk/index.html#Reqs)
|
||||
|
||||
For each tutorial, move to its folder and run:
|
||||
|
||||
|
@ -188,7 +178,6 @@ tutorial in an Android Virtual Device (AVD), make sure to create the
|
|||
device with support for audio playback and GPU Emulation (to enable
|
||||
OpenGL ES).
|
||||
|
||||
|
||||
> ![](images/icons/emoticons/warning.png) Windows linkage problems
|
||||
>
|
||||
> Due to problems related to the standard linker, Google’s <a href="http://en.wikipedia.org/wiki/Gold_(linker)" class="external-link">Gold Linker</a> is used to build GStreamer applications. Unfortunately, the Android NDK toolchain for Windows does not include the gold linker and the standard one has to be used.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Installing for iOS development
|
||||
|
||||
![](images/icons/emoticons/information.png) All versions starting form iOS 6 are supported
|
||||
|
||||
## Prerequisites
|
||||
|
||||
For iOS development you need to download Xcode and the iOS SDK. Xcode
|
||||
|
@ -86,4 +88,3 @@ Once a project has been created using a GStreamer SDK Template, it is
|
|||
ready to build and run. All necessary infrastructure is already in
|
||||
place. To understand what files have been created and how they interact,
|
||||
take a look at the [iOS tutorials](iOS+tutorials.markdown).
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Installing on Linux
|
||||
# Installing on Linux
|
||||
|
||||
This page last changed on Jun 12, 2013 by slomo.
|
||||
|
||||
|
@ -61,7 +61,7 @@ distribution:
|
|||
|
||||
And copy it to the `/etc/apt/sources.list.d/` directory on your system:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
sudo cp gstreamer-sdk.list /etc/apt/sources.list.d/
|
||||
```
|
||||
|
||||
|
@ -70,7 +70,7 @@ be added and the apt repository list needs to be refreshed. This can be
|
|||
done by
|
||||
running:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
wget -q -O - http://www.freedesktop.org/software/gstreamer-sdk/sdk.gpg | sudo apt-key add -
|
||||
sudo apt-get update
|
||||
```
|
||||
|
@ -78,7 +78,7 @@ sudo apt-get update
|
|||
Now that the new repositories are available, install the SDK with the
|
||||
following command:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
sudo apt-get install gstreamer-sdk-dev
|
||||
```
|
||||
|
||||
|
@ -103,7 +103,7 @@ distribution:
|
|||
|
||||
And copy it to the `/etc/apt/sources.list.d/` directory on your system:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
su -c 'cp gstreamer-sdk.list /etc/apt/sources.list.d/'
|
||||
```
|
||||
|
||||
|
@ -112,7 +112,7 @@ be added and the apt repository list needs to be refreshed. This can be
|
|||
done by
|
||||
running:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
su -c 'wget -q -O - http://www.freedesktop.org/software/gstreamer-sdk/sdk.gpg | apt-key add -'
|
||||
su -c 'apt-get update'
|
||||
```
|
||||
|
@ -120,7 +120,7 @@ su -c 'apt-get update'
|
|||
Now that the new repositories are available, install the SDK with the
|
||||
following command:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
su -c 'apt-get install gstreamer-sdk-dev'
|
||||
```
|
||||
|
||||
|
@ -141,21 +141,21 @@ distribution:
|
|||
|
||||
And copy it to the `/etc/yum.repos.d/` directory on your system:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
su -c 'cp gstreamer-sdk.repo /etc/yum.repos.d/'
|
||||
```
|
||||
|
||||
After adding the repositories, the yum repository list needs to be
|
||||
refreshed. This can be done by running:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
su -c 'yum update'
|
||||
```
|
||||
|
||||
Now that the new repositories are available, install the SDK with the
|
||||
following command:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
su -c 'yum install gstreamer-sdk-devel'
|
||||
```
|
||||
|
||||
|
@ -170,7 +170,7 @@ installed in a non-standard location `/opt/gstreamer-sdk`. The shell
|
|||
script `gst-sdk-shell` sets the required environment variables for
|
||||
building applications with the GStreamer SDK:
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
/opt/gstreamer-sdk/bin/gst-sdk-shell
|
||||
```
|
||||
|
||||
|
@ -179,7 +179,7 @@ the `gcc` compiler and a text editor. In order to compile code that
|
|||
requires the GStreamer SDK and uses the GStreamer core library, remember
|
||||
to add this string to your `gcc` command:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
`pkg-config --cflags --libs gstreamer-0.10`
|
||||
```
|
||||
|
||||
|
@ -214,7 +214,7 @@ available in a GIT repository and distributed with the SDK.
|
|||
|
||||
The GIT repository can be cloned with:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
git clone git://anongit.freedesktop.org/gstreamer-sdk/gst-sdk-tutorials
|
||||
```
|
||||
|
||||
|
@ -231,7 +231,7 @@ Run `/opt/gstreamer-sdk/bin/gst-sdk-shell` to enter this shell.
|
|||
Then go to the folder where you copied/cloned the tutorials and
|
||||
write:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gcc basic-tutorial-1.c -o basic-tutorial-1 `pkg-config --cflags --libs gstreamer-0.10`
|
||||
```
|
||||
|
||||
|
@ -254,7 +254,7 @@ Using the file name of the tutorial you are interested in
|
|||
To run the tutorials, simply execute the desired tutorial (**from within
|
||||
the `gst-sdk-shell`**):
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: false
|
||||
``` lang=c
|
||||
./basic-tutorial-1
|
||||
```
|
||||
|
||||
|
@ -282,4 +282,3 @@ the `gensdkshell` command of the Cerbero build system, if you built
|
|||
the SDK yourself as explained above.
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
# Installing on Mac OS X
|
||||
|
||||
## Supported platforms
|
||||
|
||||
* 10.6 (Snow Leopard)
|
||||
* 10.7 (Lion)
|
||||
* 10.8 (Mountain Lion)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
**FIXME: Those all need updating**
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
# Installing on Windows
|
||||
|
||||
## Supported platforms
|
||||
|
||||
* Windows XP
|
||||
* Windows Vista
|
||||
* Windows 7
|
||||
* Windows 8
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To develop applications using the GStreamer SDK for Windows you will
|
||||
|
@ -48,7 +55,6 @@ There are 3 sets of files in the SDK:
|
|||
Get **the Runtime and Development files** installers appropriate for
|
||||
your architecture from here:
|
||||
|
||||
|
||||
**FIXME: Add links **
|
||||
|
||||
> ![Warning](images/icons/emoticons/warning.png)
|
||||
|
@ -60,7 +66,6 @@ default is usually OK.
|
|||
> ![Warning](images/icons/emoticons/warning.png)
|
||||
>`If you plan to use Visual Studio, **close it before installing the GStreamer SDK**. The installer will define new environment variables which will not be picked up by Visual Studio if it is open.
|
||||
|
||||
|
||||
> On **Windows 8** and **Windows 10**, it might be necessary to log out and log back in to your account after the installation for the newly defined environment variables to be picked up by Visual Studio.
|
||||
|
||||
It is the application's responsibility to ensure that, at runtime,
|
||||
|
@ -141,7 +146,6 @@ Explorer)
|
|||
|
||||
You should now be able to run the tutorials.
|
||||
|
||||
|
||||
### Creating new projects manually
|
||||
|
||||
**If you want to create 64-bit applications, remember also to create x64
|
||||
|
@ -169,7 +173,6 @@ default.
|
|||
|
||||
![](attachments/WindowsInstall10.png)
|
||||
|
||||
|
||||
> ![Warning](images/icons/emoticons/warning.png)
|
||||
> **Depending on the GStreamer libraries you need to use, you will have to add more property pages, besides `gstreamer-1.0`** (each property page corresponds to one GStreamer library).
|
||||
>
|
||||
|
|
|
@ -1,81 +1,16 @@
|
|||
# Installing the SDK
|
||||
|
||||
### Choose your platform
|
||||
## Choose your platform by clicking on the corresponding logo
|
||||
|
||||
<table>
|
||||
<colgroup>
|
||||
<col width="33%" />
|
||||
<col width="33%" />
|
||||
<col width="33%" />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td><p><a href="Installing%2Bon%2BLinux.html"><img src="attachments/linux.png" class="confluence-embedded-image image-center" /></a></p>
|
||||
<h3 id="InstallingtheSDK-Linux" style="text-align: center;">Linux</h3>
|
||||
<ul>
|
||||
<li>Ubuntu 12.04 (Precise Pangolin)</li>
|
||||
<li>Ubuntu 12.10 (Quantal <span style="color: rgb(0,0,0);">Quetzal</span>)</li>
|
||||
<li>Debian 6.0 (Squeeze)</li>
|
||||
<li>Debian 7.0 (Wheezy)</li>
|
||||
<li>Fedora 16</li>
|
||||
<li>Fedora 17</li>
|
||||
</ul>
|
||||
<p><span style="color: rgb(255,255,255);">______________________________________</span></p></td>
|
||||
<td><p><a href="Installing%2Bon%2BMac%2BOS%2BX.html"><img src="attachments/mac.png" class="confluence-embedded-image image-center" /></a></p>
|
||||
<h3 id="InstallingtheSDK-MacOSX" style="text-align: center;">Mac OS X</h3>
|
||||
<ul>
|
||||
<li>10.6 (Snow Leopard)</li>
|
||||
<li>10.7 (Lion)</li>
|
||||
<li>10.8 (Mountain Lion)</li>
|
||||
</ul>
|
||||
<p><span style="color: rgb(255,255,255);">______________________________________</span></p></td>
|
||||
<td><p><a href="Installing%2Bon%2BWindows.html"><img src="attachments/windows.png" class="confluence-embedded-image image-center" /></a></p>
|
||||
<h3 id="InstallingtheSDK-MicrosoftWindows" style="text-align: center;">Microsoft Windows</h3>
|
||||
<ul>
|
||||
<li>Windows XP</li>
|
||||
<li>Windows Vista</li>
|
||||
<li>Windows 7</li>
|
||||
<li>Windows 8</li>
|
||||
</ul>
|
||||
<p><span style="color: rgb(255,255,255);">______________________________________</span></p>
|
||||
<div>
|
||||
<span style="color: rgb(255,255,255);"><br />
|
||||
</span>
|
||||
</div></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
[![](attachments/1540163.png)](Installing+on+Mac+OS+X.markdown) [![](attachments/1540164.png)](Installing+on+Windows.markdown) [![](attachments/2654239.png)](Installing+for+Android+development.markdown) [![](attachments/3539150.jpeg)](Installing+for+iOS+development.markdown)
|
||||
|
||||
<table>
|
||||
<colgroup>
|
||||
<col width="50%" />
|
||||
<col width="50%" />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td><p><a href="Installing%2Bfor%2BAndroid%2Bdevelopment.html"><img src="attachments/android.png" class="confluence-embedded-image image-center" /></a></p>
|
||||
<h3 id="InstallingtheSDK-Android" style="text-align: center;">Android</h3>
|
||||
<ul>
|
||||
<li>2.3.1 Gingerbread and above</li>
|
||||
</ul>
|
||||
<p><span style="color: rgb(255,255,255);">______________________________________</span></p>
|
||||
<div>
|
||||
<span style="color: rgb(255,255,255);"><br />
|
||||
</span>
|
||||
</div></td>
|
||||
<td><p><a href="Installing%2Bfor%2BiOS%2Bdevelopment.html"><img src="attachments/ios.jpeg" class="confluence-embedded-image image-center" /></a></p>
|
||||
<h3 id="InstallingtheSDK-iOS" style="text-align: center;">iOS</h3>
|
||||
<ul>
|
||||
<li>iOS 6 and above</li>
|
||||
</ul>
|
||||
<p><span style="color: rgb(255,255,255);">______________________________________</span></p>
|
||||
<div>
|
||||
<span style="color: rgb(255,255,255);"><br />
|
||||
</span>
|
||||
</div></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
## Linux
|
||||
|
||||
The installation instructions are different depending on your platform.
|
||||
Please select the appropriate one by clicking on its logo.
|
||||
The GStreamer community does not provide the SDK for GNU/Linux platforms
|
||||
as it will always be available through package managers on all
|
||||
distribution. It is also always installed by default on desktop
|
||||
environments, you will just need to make sure you have the development
|
||||
packages installed (refer to your distribution documentation for more
|
||||
information). If you really want to run the Sdk on Linux, you can
|
||||
always follow the instructions to
|
||||
[build from source using cerbero](Building+from+source+using+Cerbero.markdown).
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Legal information
|
||||
# Legal information
|
||||
|
||||
This page last changed on Jun 11, 2012 by xartigas.
|
||||
|
||||
|
@ -219,4 +219,3 @@ that the license of the conditions of the resulting program must allow
|
|||
decompilation to debug modifications to the library.
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:28
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Mac OS X deployment
|
||||
# Mac OS X deployment
|
||||
|
||||
This page last changed on Nov 28, 2012 by xartigas.
|
||||
|
||||
|
@ -31,7 +31,7 @@ should replace `$INSTALL_PATH` with the path where your installer copied
|
|||
the SDK's disk image files (the `/tmp` directory is good place to
|
||||
install it as it will be removed at the end of the installation):
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
hdiutil attach $INSTALL_PATH/gstreamer-sdk-2012.7-x86.dmg
|
||||
cd /Volumes/gstreamer-sdk-2012.7-x86/
|
||||
installer -pkg gstreamer-sdk-2012.7-x86.pkg -target "/"
|
||||
|
@ -47,7 +47,7 @@ simply copy the framework to the application's Frameworks folder as
|
|||
defined in the [bundle programming
|
||||
guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW19):
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
cp -r /Library/Frameworks/GStreamer.framework ~/MyApp.app/Contents/Frameworks
|
||||
```
|
||||
|
||||
|
@ -56,7 +56,7 @@ different architectures, installed in the system. Make sure you only
|
|||
copy the version you need and that you update accordingly the link
|
||||
`GStreamer.framework/Version/Current`:
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
$ ls -l Frameworks/GStreamer.framework/Version/Current
|
||||
lrwxr-xr-x 1 fluendo staff 21 Jun 5 18:46 Frameworks/GStreamer.framework/Versions/Current -> ../Versions/0.10/x86
|
||||
```
|
||||
|
@ -274,7 +274,7 @@ We can get the list of paths used by an object file to locate its
|
|||
dependent dynamic libraries
|
||||
using [otool](https://developer.apple.com/library/mac/#documentation/darwin/reference/manpages/man1/otool.1.html):
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
$ otool -L /Library/Frameworks/GStreamer.framework/Commands/gst-launch-0.10
|
||||
/Library/Frameworks/GStreamer.framework/Commands/gst-launch-0.10:
|
||||
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.43.0)
|
||||
|
@ -293,7 +293,7 @@ This full path is extracted from the dynamic library ***install name***
|
|||
install name of a library can be retrieved with
|
||||
[otool](https://developer.apple.com/library/mac/#documentation/darwin/reference/manpages/man1/otool.1.html) too:
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
$ otool -D /Library/Frameworks/GStreamer.framework/Libraries/libgstreamer-0.10.dylib
|
||||
/Library/Frameworks/GStreamer.framework/Libraries/libgstreamer-0.10.dylib:
|
||||
/Library/Frameworks/GStreamer.framework/Versions/0.10/x86/lib/libgstreamer-0.10.0.dylib
|
||||
|
@ -348,7 +348,7 @@ When looking for binaries to fix, we will run the script in the
|
|||
following
|
||||
directories:
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
$ osxrelocator.py MyApp.app/Contents/Frameworks/GStreamer.framework/Versions/Current/lib /Library/Frameworks/GStreamer.framework/ @executable_path/../Frameworks/GStreamer.framework/ -r
|
||||
$ osxrelocator.py MyApp.app/Contents/Frameworks/GStreamer.framework/Versions/Current/libexec /Library/Frameworks/GStreamer.framework/ @executable_path/../Frameworks/GStreamer.framework/ -r
|
||||
$ osxrelocator.py MyApp.app/Contents/Frameworks/GStreamer.framework/Versions/Current/bin /Library/Frameworks/GStreamer.framework/ @executable_path/../Frameworks/GStreamer.framework/ -r
|
||||
|
@ -381,4 +381,3 @@ You can use the following functions:
|
|||
[PackageMaker2.png](attachments/2097292/2424842.png) (image/png)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Multiplatform deployment using Cerbero
|
||||
# Multiplatform deployment using Cerbero
|
||||
|
||||
This page last changed on Nov 21, 2012 by slomo.
|
||||
|
||||
|
@ -28,7 +28,7 @@ In the Cerbero installation directory you will find the
|
|||
`cerbero-uninstalled` script. Execute it without parameters to see the
|
||||
list of commands it accepts:
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
./cerbero-uninstalled
|
||||
```
|
||||
|
||||
|
@ -37,7 +37,7 @@ list of commands it accepts:
|
|||
The first step is to create an empty recipe that you can then tailor to
|
||||
your needs:
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
./cerbero-uninstalled add-recipe my-app 1.0
|
||||
```
|
||||
|
||||
|
@ -204,7 +204,7 @@ Alternatively, you can pass some options to cerbero-uninstalled so some
|
|||
of these attributes are already set for you. For
|
||||
example:
|
||||
|
||||
``` theme: Default; brush: python; gutter: false
|
||||
```
|
||||
./cerbero-uninstalled add-recipe --licenses "LGPL" --deps "glib,gtk+" --origin "git://git.my-app.com" --commit "git-commit-to-use" my-app 1.0
|
||||
```
|
||||
|
||||
|
@ -212,7 +212,7 @@ See `./cerbero-uninstalled add-recipe -h` for help.
|
|||
|
||||
As an example, this is the recipe used to build the Snappy media player:
|
||||
|
||||
``` theme: Default; brush: python; gutter: false
|
||||
```
|
||||
class Recipe(recipe.Recipe):
|
||||
name = 'snappy'
|
||||
version = '0.2+git'
|
||||
|
@ -223,11 +223,9 @@ class Recipe(recipe.Recipe):
|
|||
use_system_libs = True
|
||||
remotes = {'upstream': 'git://git.gnome.org/snappy'}
|
||||
|
||||
|
||||
files_bins = ['snappy']
|
||||
files_data = ['share/snappy']
|
||||
|
||||
|
||||
def prepare(self):
|
||||
if self.config.target_platform == Platform.LINUX:
|
||||
self.configure_options += ' --enable-dbus'
|
||||
|
@ -244,7 +242,7 @@ Snappy.
|
|||
|
||||
Once the recipe is ready, instruct Cerbero to build it:
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
./cerbero-uninstalled build my-app
|
||||
```
|
||||
|
||||
|
@ -259,7 +257,7 @@ files in `cerbero/packages`.
|
|||
|
||||
Now, to create an empty package, do:
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
./cerbero-uninstalled add-package my-app 1.0
|
||||
```
|
||||
|
||||
|
@ -412,7 +410,7 @@ Alternatively you can also pass some options to `cerbero-uninstalled`,
|
|||
for
|
||||
example:
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
./cerbero-uninstalled add-package my-app 1.0 --license "LGPL" --codename MyApp --vendor MyAppVendor --url "http://www.my-app.com" --files=my-app:bins:libs --files-devel=my-app:devel --platform-files=linux:my-app:linux_specific --platform-files-devel=linux:my-app:linux_specific_devel,windows:my-app:windows_specific_devel --deps base-system --includes gstreamer-core
|
||||
```
|
||||
|
||||
|
@ -421,7 +419,7 @@ See `./cerbero-uninstalled add-package -h` for help.
|
|||
As an example, this is the package file that is used for packaging the
|
||||
`gstreamer-core` package:
|
||||
|
||||
``` theme: Default; brush: python; gutter: false
|
||||
```
|
||||
class Package(package.Package):
|
||||
name = 'gstreamer-codecs'
|
||||
shortdesc = 'GStreamer codecs'
|
||||
|
@ -433,7 +431,6 @@ class Package(package.Package):
|
|||
uuid = '6cd161c2-4535-411f-8287-e8f6a892f853'
|
||||
deps = ['gstreamer-core']
|
||||
|
||||
|
||||
files = ['flac:libs',
|
||||
'jasper:libs', 'libkate:libs',
|
||||
'libogg:libs', 'schroedinger:libs', 'speex:libs',
|
||||
|
@ -475,7 +472,7 @@ packages\_prefix as the ones in your Cerbero configuration file.
|
|||
|
||||
Finally, build your package by using:
|
||||
|
||||
``` theme: Default; brush: bash; gutter: false
|
||||
``` lang=bash
|
||||
./cerbero-uninstalled package your-package
|
||||
```
|
||||
|
||||
|
@ -486,4 +483,3 @@ the dependencies and your software). The resulting files will be in the
|
|||
current working directory.
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
# GStreamer SDK documentation : Playback tutorial 1: Playbin2 usage
|
||||
|
||||
This page last changed on Jun 26, 2012 by xartigas.
|
||||
# Playback tutorial 1: Playbin usage
|
||||
|
||||
# Goal
|
||||
|
||||
|
@ -43,15 +41,14 @@ Finally, multiple video streams can also be found in a single file, for
|
|||
example, in DVD with multiple angles of the same scene, but they are
|
||||
somewhat rare.
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td><img src="images/icons/emoticons/information.png" width="16" height="16" /></td>
|
||||
<td><p>Embedding multiple streams inside a single file is called “multiplexing” or “muxing”, and such file is then known as a “container”. Common container formats are Matroska (.mkv), Quicktime (.qt, .mov, .mp4), Ogg (.ogg) or Webm (.webm).</p>
|
||||
<p>Retrieving the individual streams from within the container is called “demultiplexing” or “demuxing”.</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
> ![](images/icons/emoticons/information.png) Embedding multiple streams
|
||||
> inside a single file is called “multiplexing” or “muxing”, and such file
|
||||
> is then known as a “container”. Common container formats are Matroska
|
||||
> (.mkv), Quicktime (.qt, .mov, .mp4), Ogg (.ogg) or Webm (.webm).
|
||||
>
|
||||
>
|
||||
> Retrieving the individual streams from within the container is called
|
||||
> “demultiplexing” or “demuxing”.
|
||||
|
||||
The following code recovers the amount of streams in the file, their
|
||||
associated metadata, and allows switching the audio stream while the
|
||||
|
@ -64,7 +61,7 @@ it in the SDK installation).
|
|||
|
||||
**playback-tutorial-1.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <gst/gst.h>
|
||||
|
||||
/* Structure to contain all our information, so we can pass it around */
|
||||
|
@ -285,36 +282,57 @@ static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomDa
|
|||
}
|
||||
```
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td><img src="images/icons/emoticons/information.png" width="16" height="16" /></td>
|
||||
<td><div id="expander-1972852059" class="expand-container">
|
||||
<div id="expander-control-1972852059" class="expand-control">
|
||||
<span class="expand-control-icon"><img src="images/icons/grey_arrow_down.gif" class="expand-control-image" /></span><span class="expand-control-text">Need help? (Click to expand)</span>
|
||||
</div>
|
||||
<div id="expander-content-1972852059" class="expand-content">
|
||||
<p>If you need help to compile this code, refer to the <strong>Building the tutorials</strong> section for your platform: <a href="Installing%2Bon%2BLinux.html#InstallingonLinux-Build">Linux</a>, <a href="Installing%2Bon%2BMac%2BOS%2BX.html#InstallingonMacOSX-Build">Mac OS X</a> or <a href="Installing%2Bon%2BWindows.html#InstallingonWindows-Build">Windows</a>, or use this specific command on Linux:</p>
|
||||
<div class="panel" style="border-width: 1px;">
|
||||
<div class="panelContent">
|
||||
<p><code>gcc playback-tutorial-1.c -o playback-tutorial-1 `pkg-config --cflags --libs gstreamer-0.10`</code></p>
|
||||
</div>
|
||||
</div>
|
||||
<p>If you need help to run this code, refer to the <strong>Running the tutorials</strong> section for your platform: <a href="Installing%2Bon%2BLinux.html#InstallingonLinux-Run">Linux</a>, <a href="Installing%2Bon%2BMac%2BOS%2BX.html#InstallingonMacOSX-Run">Mac OS X</a> or <a href="Installing%2Bon%2BWindows.html#InstallingonWindows-Run">Windows</a></p>
|
||||
<p></p>
|
||||
<p><span>This tutorial opens a window and displays a movie, with accompanying audio. The media is fetched from the Internet, so the window might take a few seconds to appear, depending on your connection speed. The number of audio streams is shown in the terminal, and the user can switch from one to another by entering a number and pressing enter. A small delay is to be expected.</span></p>
|
||||
<p><span><span>Bear in mind that there is no latency management (buffering), so on slow connections, the movie might stop after a few seconds. See how </span><a href="http://docs.gstreamer.com/display/GstSDK/Tutorial+12%3A+Live+streaming">Tutorial 12: Live streaming</a><span> solves this issue.</span></span></p>
|
||||
<p></p>
|
||||
<p>Required libraries: <code>gstreamer-0.10</code></p>
|
||||
</div>
|
||||
</div></td>
|
||||
> ![](images/icons/emoticons/information.png) If you need help to compile this code, refer to the **Building the
|
||||
> tutorials** section for your platform: [Mac](Installing+on+Mac+OS+X.markdown) or [Windows](Installing+on+Windows)
|
||||
> or use this specific command on Linux:
|
||||
> ```gcc playback-tutorial-1.c -o playback-tutorial-1 `pkg-config --cflags --libs gstreamer-1.0` ```
|
||||
|
||||
If you need help to run this code, refer to the **Running the
|
||||
tutorials** section for your platform:
|
||||
[Mac OS X](Installing+on+Mac+OS+X.markdown#building-the-tutorials),
|
||||
[Windows](Installing+on+Windows.markdown#running-the-tutorials), for
|
||||
[iOS](Installing+for+iOS+development.markdown#building-the-tutorials) or for
|
||||
[android](Installing+for+Android+development.markdown#building-the-tutorials).
|
||||
|
||||
This tutorial opens a window and displays a movie, with accompanying
|
||||
audio. The media is fetched from the Internet, so the window might take
|
||||
a few seconds to appear, depending on your connection speed. The number
|
||||
of audio streams is shown in the terminal, and the user can switch from
|
||||
one to another by entering a number and pressing enter. A small delay is
|
||||
to be expected.
|
||||
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
Bear in mind that there is no latency management (buffering), so on slow
|
||||
connections, the movie might stop after a few seconds. See
|
||||
how <a href="http://docs.gstreamer.com/display/GstSDK/Tutorial+12%3A+Live+streaming">Tutorial
|
||||
12: Live streaming</a> solves this issue.
|
||||
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
Required libraries: <code>gstreamer-0.10</code>
|
||||
|
||||
</p>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
# Walkthrough
|
||||
|
||||
``` first-line: 3; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Structure to contain all our information, so we can pass it around */
|
||||
typedef struct _CustomData {
|
||||
GstElement *playbin2; /* Our one and only element */
|
||||
|
@ -337,7 +355,7 @@ streams of each type, and the currently playing one. Also, we are going
|
|||
to use a different mechanism to wait for messages that allows
|
||||
interactivity, so we need a GLib's main loop object.
|
||||
|
||||
``` first-line: 18; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* playbin2 flags */
|
||||
typedef enum {
|
||||
GST_PLAY_FLAG_VIDEO = (1 << 0), /* We want video output */
|
||||
|
@ -356,7 +374,7 @@ be retrieved at runtime without using this trick, but in a far more
|
|||
cumbersome
|
||||
way.
|
||||
|
||||
``` first-line: 25; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Forward definition for the message and keyboard processing functions */
|
||||
static gboolean handle_message (GstBus *bus, GstMessage *msg, CustomData *data);
|
||||
static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomData *data);
|
||||
|
@ -375,7 +393,7 @@ the pipeline, and use directly the `playbin2` element.
|
|||
|
||||
We focus on some of the other properties of `playbin2`, though:
|
||||
|
||||
``` first-line: 50; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Set flags to show Audio and Video but ignore Subtitles */
|
||||
g_object_get (data.playbin2, "flags", &flags, NULL);
|
||||
flags |= GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_AUDIO;
|
||||
|
@ -387,31 +405,15 @@ g_object_set (data.playbin2, "flags", flags, NULL);
|
|||
can have any combination of `GstPlayFlags`. The most interesting values
|
||||
are:
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td><p><a href=""></a><span class="term"><code class="literal">GST_PLAY_FLAG_VIDEO</code></span></p></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><p><a href=""></a><span class="term"><code class="literal">GST_PLAY_FLAG_AUDIO</code></span></p></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><p><a href=""></a><span class="term"><code class="literal">GST_PLAY_FLAG_TEXT</code></span></p></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><p><a href=""></a><span class="term"><code class="literal">GST_PLAY_FLAG_VIS</code></span></p></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><p><a href=""></a><span class="term"><code class="literal">GST_PLAY_FLAG_DOWNLOAD</code></span></p></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><p><a href=""></a><span class="term"><code class="literal">GST_PLAY_FLAG_BUFFERING</code></span></p></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><p><a href=""></a><span class="term"><code class="literal">GST_PLAY_FLAG_DEINTERLACE</code></span></p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
| | |
|
||||
|---------------------------|------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| GST_PLAY_FLAG_VIDEO | Enable video rendering. If this flag is not set, there will be no video output. |
|
||||
| GST_PLAY_FLAG_AUDIO | Enable audio rendering. If this flag is not set, there will be no audio output. |
|
||||
| GST_PLAY_FLAG_TEXT | Enable subtitle rendering. If this flag is not set, subtitles will not be shown in the video output. |
|
||||
| GST_PLAY_FLAG_VIS | Enable rendering of visualisations when there is no video stream. Playback tutorial 6: Audio visualization goes into more details. |
|
||||
| GST_PLAY_FLAG_DOWNLOAD | See Basic tutorial 12: Streaming and Playback tutorial 4: Progressive streaming. |
|
||||
| GST_PLAY_FLAG_BUFFERING | See Basic tutorial 12: Streaming and Playback tutorial 4: Progressive streaming. |
|
||||
| GST_PLAY_FLAG_DEINTERLACE | If the video content was interlaced, this flag instructs playbin2 to deinterlace it before displaying it. |
|
||||
|
||||
In our case, for demonstration purposes, we are enabling audio and video
|
||||
and disabling subtitles, leaving the rest of flags to their default
|
||||
|
@ -419,7 +421,7 @@ values (this is why we read the current value of the flags with
|
|||
`g_object_get()` before overwriting it with
|
||||
`g_object_set()`).
|
||||
|
||||
``` first-line: 56; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Set connection speed. This will affect some internal decisions of playbin2 */
|
||||
g_object_set (data.playbin2, "connection-speed", 56, NULL);
|
||||
```
|
||||
|
@ -435,13 +437,13 @@ We have set all these properties one by one, but we could have all of
|
|||
them with a single call to
|
||||
`g_object_set()`:
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: false
|
||||
``` lang=c
|
||||
g_object_set (data.playbin2, "uri", "http://docs.gstreamer.com/media/sintel_cropped_multilingual.webm", "flags", flags, "connection-speed", 56, NULL);
|
||||
```
|
||||
|
||||
This is why `g_object_set()` requires a NULL as the last parameter.
|
||||
|
||||
``` first-line: 63; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Add a keyboard watch so we get notified of keystrokes */
|
||||
#ifdef _WIN32
|
||||
io_stdin = g_io_channel_win32_new_fd (fileno (stdin));
|
||||
|
@ -459,7 +461,7 @@ GStreamer has little to do with it besides the Navigation interface
|
|||
discussed briefly in [Tutorial 17: DVD
|
||||
playback](http://docs.gstreamer.com/display/GstSDK/Tutorial+17%3A+DVD+playback).
|
||||
|
||||
``` first-line: 79; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Create a GLib Main Loop and set it to run */
|
||||
data.main_loop = g_main_loop_new (NULL, FALSE);
|
||||
g_main_loop_run (data.main_loop);
|
||||
|
@ -476,7 +478,7 @@ times: `handle_message` when a message appears on the bus, and
|
|||
There is nothing new in handle\_message, except that when the pipeline
|
||||
moves to the PLAYING state, it will call the `analyze_streams` function:
|
||||
|
||||
``` first-line: 92; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Extract some metadata from the streams and print it on the screen */
|
||||
static void analyze_streams (CustomData *data) {
|
||||
gint i;
|
||||
|
@ -495,7 +497,7 @@ media and prints it on the screen. The number of video, audio and
|
|||
subtitle streams is directly available through the `n-video`,
|
||||
`n-audio` and `n-text` properties.
|
||||
|
||||
``` first-line: 108; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
for (i = 0; i < data->n_video; i++) {
|
||||
tags = NULL;
|
||||
/* Retrieve the stream's video tags */
|
||||
|
@ -515,15 +517,42 @@ stored as tags in a `GstTagList` structure, which is a list of data
|
|||
pieces identified by a name. The `GstTagList` associated with a stream
|
||||
can be recovered with `g_signal_emit_by_name()`, and then individual
|
||||
tags are extracted with the `gst_tag_list_get_*` functions
|
||||
like `gst_tag_list_get_string()` for example.
|
||||
like `gst_tag_list_get_string()` for
|
||||
example.
|
||||
|
||||
<table>
|
||||
|
||||
<tbody>
|
||||
|
||||
<tr class="odd">
|
||||
<td><img src="images/icons/emoticons/information.png" width="16" height="16" /></td>
|
||||
<td><p>This rather unintuitive way of retrieving the tag list is called an Action Signal. Action signals are emitted by the application to a specific element, which then performs an action and returns a result. They behave like a dynamic function call, in which methods of a class are identified by their name (the signal's name) instead of their memory address. These signals are listed In the documentation along with the regular signals, and are tagged “Action”. See <code>playbin2</code>, for example.</p></td>
|
||||
|
||||
<td>
|
||||
|
||||
<img src="images/icons/emoticons/information.png" width="16" height="16" />
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<p>
|
||||
|
||||
This rather unintuitive way of retrieving the tag list is called an
|
||||
Action Signal. Action signals are emitted by the application to a
|
||||
specific element, which then performs an action and returns a result.
|
||||
They behave like a dynamic function call, in which methods of a class
|
||||
are identified by their name (the signal's name) instead of their memory
|
||||
address. These signals are listed In the documentation along with the
|
||||
regular signals, and are tagged “Action”. See <code>playbin2</code>, for
|
||||
example.
|
||||
|
||||
</p>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
`playbin2` defines 3 action signals to retrieve
|
||||
|
@ -534,7 +563,7 @@ name if the tags is standardized, and the list can be found in the
|
|||
`GST_TAG_*_CODEC` (audio, video or
|
||||
text).
|
||||
|
||||
``` first-line: 158; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
g_object_get (data->playbin2, "current-video", &data->current_video, NULL);
|
||||
g_object_get (data->playbin2, "current-audio", &data->current_audio, NULL);
|
||||
g_object_get (data->playbin2, "current-text", &data->current_text, NULL);
|
||||
|
@ -550,7 +579,7 @@ never make any assumption. Multiple internal conditions can make
|
|||
in which the streams are listed can change from one run to another, so
|
||||
checking the metadata to identify one particular stream becomes crucial.
|
||||
|
||||
``` first-line: 202; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Process keyboard input */
|
||||
static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomData *data) {
|
||||
gchar *str = NULL;
|
||||
|
@ -611,6 +640,3 @@ Remember that attached to this page you should find the complete source
|
|||
code of the tutorial and any accessory files needed to build it.
|
||||
|
||||
It has been a pleasure having you here, and see you soon\!
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Playback tutorial 2: Subtitle management
|
||||
# Playback tutorial 2: Subtitle management
|
||||
|
||||
This page last changed on May 16, 2012 by xartigas.
|
||||
|
||||
|
@ -41,7 +41,7 @@ it in the SDK installation).
|
|||
|
||||
**playback-tutorial-2.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <gst/gst.h>
|
||||
|
||||
/* Structure to contain all our information, so we can pass it around */
|
||||
|
@ -297,7 +297,7 @@ This tutorial is copied from [Playback tutorial 1: Playbin2
|
|||
usage](Playback%2Btutorial%2B1%253A%2BPlaybin2%2Busage.html) with some
|
||||
changes, so let's review only the changes.
|
||||
|
||||
``` first-line: 50; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Set the subtitle URI to play and some font description */
|
||||
g_object_set (data.playbin2, "suburi", "http://docs.gstreamer.com/media/sintel_trailer_gr.srt", NULL);
|
||||
g_object_set (data.playbin2, "subtitle-font-desc", "Sans, 18", NULL);
|
||||
|
@ -351,7 +351,7 @@ Extra-Expanded, Ultra-Expanded
|
|||
|
||||
|
||||
|
||||
``` first-line: 54; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Set flags to show Audio, Video and Subtitles */
|
||||
g_object_get (data.playbin2, "flags", &flags, NULL);
|
||||
flags |= GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_AUDIO | GST_PLAY_FLAG_TEXT;
|
||||
|
@ -400,4 +400,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
</table>
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Playback tutorial 3: Short-cutting the pipeline
|
||||
# Playback tutorial 3: Short-cutting the pipeline
|
||||
|
||||
This page last changed on Jun 26, 2012 by xartigas.
|
||||
|
||||
|
@ -32,7 +32,7 @@ Copy this code into a text file named `playback-tutorial-3.c`.
|
|||
|
||||
**playback-tutorial-3.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <gst/gst.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -190,7 +190,7 @@ int main(int argc, char *argv[]) {
|
|||
To use an `appsrc` as the source for the pipeline, simply instantiate a
|
||||
`playbin2` and set its URI to `appsrc://`
|
||||
|
||||
``` first-line: 131; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Create the playbin2 element */
|
||||
data.pipeline = gst_parse_launch ("playbin2 uri=appsrc://", NULL);
|
||||
```
|
||||
|
@ -199,7 +199,7 @@ data.pipeline = gst_parse_launch ("playbin2 uri=appsrc://", NULL);
|
|||
`source-setup` signal to allow the application to configure
|
||||
it:
|
||||
|
||||
``` first-line: 133; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
g_signal_connect (data.pipeline, "source-setup", G_CALLBACK (source_setup), &data);
|
||||
```
|
||||
|
||||
|
@ -208,7 +208,7 @@ since, once the signal handler returns, `playbin2` will instantiate the
|
|||
next element in the pipeline according to these
|
||||
caps:
|
||||
|
||||
``` first-line: 100; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* This function is called when playbin2 has created the appsrc element, so we have
|
||||
* a chance to configure it. */
|
||||
static void source_setup (GstElement *pipeline, GstElement *source, CustomData *data) {
|
||||
|
@ -269,4 +269,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
[playback-tutorial-3.c](attachments/1442200/2424848.c) (text/plain)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Playback tutorial 4: Progressive streaming
|
||||
# Playback tutorial 4: Progressive streaming
|
||||
|
||||
This page last changed on Sep 13, 2012 by xartigas.
|
||||
|
||||
|
@ -54,7 +54,7 @@ Copy this code into a text file named `playback-tutorial-4.c`.
|
|||
|
||||
**playback-tutorial-4.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <gst/gst.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -260,7 +260,7 @@ only the differences.
|
|||
|
||||
#### Setup
|
||||
|
||||
``` first-line: 133; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Set the download flag */
|
||||
g_object_get (pipeline, "flags", &flags, NULL);
|
||||
flags |= GST_PLAY_FLAG_DOWNLOAD;
|
||||
|
@ -271,7 +271,7 @@ By setting this flag, `playbin2` instructs its internal queue (a
|
|||
`queue2` element, actually) to store all downloaded
|
||||
data.
|
||||
|
||||
``` first-line: 157; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
g_signal_connect (pipeline, "deep-notify::temp-location", G_CALLBACK (got_location), NULL);
|
||||
```
|
||||
|
||||
|
@ -282,7 +282,7 @@ changes, indicating that the `queue2` has decided where to store the
|
|||
downloaded
|
||||
data.
|
||||
|
||||
``` first-line: 18; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static void got_location (GstObject *gstobject, GstObject *prop_object, GParamSpec *prop, gpointer data) {
|
||||
gchar *location;
|
||||
g_object_get (G_OBJECT (prop_object), "temp-location", &location, NULL);
|
||||
|
@ -313,7 +313,7 @@ removed. As the comment reads, you can keep it by setting the
|
|||
In `main` we also install a timer which we use to refresh the UI every
|
||||
second.
|
||||
|
||||
``` first-line: 159; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Register a function that GLib will call every second */
|
||||
g_timeout_add_seconds (1, (GSourceFunc)refresh_ui, &data);
|
||||
```
|
||||
|
@ -332,7 +332,7 @@ pipeline is paused). Keep in mind that if your network is fast enough,
|
|||
you will not see the download bar (the dashes) advance at all; it will
|
||||
be completely full from the beginning.
|
||||
|
||||
``` first-line: 70; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static gboolean refresh_ui (CustomData *data) {
|
||||
GstQuery *query;
|
||||
gboolean result;
|
||||
|
@ -356,7 +356,7 @@ succeeded. The answer to the query is contained in the same
|
|||
`GstQuery` structure we created, and can be retrieved using multiple
|
||||
parse methods:
|
||||
|
||||
``` first-line: 85; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
n_ranges = gst_query_get_n_buffering_ranges (query);
|
||||
for (range = 0; range < n_ranges; range++) {
|
||||
gint64 start, stop;
|
||||
|
@ -380,7 +380,7 @@ range) depends on what we requested in the
|
|||
`gst_query_new_buffering()` call. In this case, PERCENTAGE. These
|
||||
values are used to generate the graph.
|
||||
|
||||
``` first-line: 94; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
if (gst_element_query_position (data->pipeline, &format, &position) &&
|
||||
GST_CLOCK_TIME_IS_VALID (position) &&
|
||||
gst_element_query_duration (data->pipeline, &format, &duration) &&
|
||||
|
@ -402,7 +402,7 @@ depending on the buffering level. If it is below 100%, the code in the
|
|||
an ‘`X`’. If the buffering level is 100% the pipeline is in the
|
||||
`PLAYING` state and we print a ‘`>`’.
|
||||
|
||||
``` first-line: 102; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
if (data->buffering_level < 100) {
|
||||
g_print (" Buffering: %3d%%", data->buffering_level);
|
||||
} else {
|
||||
|
@ -415,7 +415,7 @@ information (and delete it otherwise).
|
|||
|
||||
#### Limiting the size of the downloaded file
|
||||
|
||||
``` first-line: 138; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Uncomment this line to limit the amount of downloaded data */
|
||||
/* g_object_set (pipeline, "ring-buffer-max-size", (guint64)4000000, NULL); */
|
||||
```
|
||||
|
@ -447,4 +447,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
[vs2010.zip](attachments/327808/2424847.zip) (application/zip)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Playback tutorial 5: Color Balance
|
||||
# Playback tutorial 5: Color Balance
|
||||
|
||||
This page last changed on Jun 25, 2012 by xartigas.
|
||||
|
||||
|
@ -44,7 +44,7 @@ Copy this code into a text file named `playback-tutorial-5.c`.
|
|||
|
||||
**playback-tutorial-5.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <string.h>
|
||||
#include <gst/gst.h>
|
||||
#include <gst/interfaces/colorbalance.h>
|
||||
|
@ -225,7 +225,7 @@ The `main()` function is fairly simple. A `playbin2` pipeline is
|
|||
instantiated and set to run, and a keyboard watch is installed so
|
||||
keystrokes can be monitored.
|
||||
|
||||
``` first-line: 45; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Output the current values of all Color Balance channels */
|
||||
static void print_current_values (GstElement *pipeline) {
|
||||
const GList *channels, *l;
|
||||
|
@ -255,7 +255,7 @@ retrieve the current value.
|
|||
In this example, the minimum and maximum values are used to output the
|
||||
current value as a percentage.
|
||||
|
||||
``` first-line: 10; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Process a color balance command */
|
||||
static void update_color_channel (const gchar *channel_name, gboolean increase, GstColorBalance *cb) {
|
||||
gdouble step;
|
||||
|
@ -283,7 +283,7 @@ parsed looking for the channel with the specified name. Obviously, this
|
|||
list could be parsed only once and the pointers to the channels be
|
||||
stored and indexed by something more efficient than a string.
|
||||
|
||||
``` first-line: 30; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Change the channel's value */
|
||||
step = 0.1 * (channel->max_value - channel->min_value);
|
||||
value = gst_color_balance_get_value (cb, channel);
|
||||
|
@ -327,4 +327,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
[vs2010.zip](attachments/327804/2424875.zip) (application/zip)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Playback tutorial 6: Audio visualization
|
||||
# Playback tutorial 6: Audio visualization
|
||||
|
||||
This page last changed on Jun 26, 2012 by xartigas.
|
||||
|
||||
|
@ -41,7 +41,7 @@ Copy this code into a text file named `playback-tutorial-6.c`.
|
|||
|
||||
**playback-tutorial-6.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <gst/gst.h>
|
||||
|
||||
/* playbin2 flags */
|
||||
|
@ -163,7 +163,7 @@ First off, we indicate `playbin2` that we want an audio visualization by
|
|||
setting the `GST_PLAY_FLAG_VIS` flag. If the media already contains
|
||||
video, this flag has no effect.
|
||||
|
||||
``` first-line: 66; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Set the visualization flag */
|
||||
g_object_get (pipeline, "flags", &flags, NULL);
|
||||
flags |= GST_PLAY_FLAG_VIS;
|
||||
|
@ -175,7 +175,7 @@ If no visualization plugin is enforced by the user, `playbin2` will use
|
|||
available). The rest of the tutorial shows how to find out the available
|
||||
visualization elements and enforce one to `playbin2`.
|
||||
|
||||
``` first-line: 32; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Get a list of all visualization plugins */
|
||||
list = gst_registry_feature_filter (gst_registry_get_default (), filter_vis_features, FALSE, NULL);
|
||||
```
|
||||
|
@ -185,7 +185,7 @@ GStreamer registry and selects those for which
|
|||
the `filter_vis_features` function returns TRUE. This function selects
|
||||
only the Visualization plugins:
|
||||
|
||||
``` first-line: 8; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Return TRUE if this is a Visualization element */
|
||||
static gboolean filter_vis_features (GstPluginFeature *feature, gpointer data) {
|
||||
GstElementFactory *factory;
|
||||
|
@ -215,7 +215,7 @@ is a “string describing the type of element, as an unordered list
|
|||
separated with slashes (/)”. Examples of classes are “Source/Network”,
|
||||
“Codec/Decoder/Video”, “Codec/Encoder/Audio” or “Visualization”.
|
||||
|
||||
``` first-line: 35; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Print their names */
|
||||
g_print("Available visualization plugins:\n");
|
||||
for (walk = list; walk != NULL; walk = g_list_next (walk)) {
|
||||
|
@ -236,7 +236,7 @@ Once we have the list of Visualization plugins, we print their names
|
|||
(`gst_element_factory_get_longname()`) and choose one (in this case,
|
||||
GOOM).
|
||||
|
||||
``` first-line: 57; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* We have now selected a factory for the visualization element */
|
||||
g_print ("Selected '%s'\n", gst_element_factory_get_longname (selected_factory));
|
||||
vis_plugin = gst_element_factory_create (selected_factory, NULL);
|
||||
|
@ -247,7 +247,7 @@ if (!vis_plugin)
|
|||
The selected factory is used to instantiate an actual `GstElement` which
|
||||
is then passed to `playbin2` through the `vis-plugin` property:
|
||||
|
||||
``` first-line: 71; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* set vis plugin for playbin2 */
|
||||
g_object_set (pipeline, "vis-plugin", vis_plugin, NULL);
|
||||
```
|
||||
|
@ -273,4 +273,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
[playback-tutorial-6.c](attachments/327802/2424879.c) (text/plain)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Playback tutorial 7: Custom playbin2 sinks
|
||||
# Playback tutorial 7: Custom playbin2 sinks
|
||||
|
||||
This page last changed on Dec 03, 2012 by xartigas.
|
||||
|
||||
|
@ -55,7 +55,7 @@ Copy this code into a text file named `playback-tutorial-7.c`.
|
|||
|
||||
**playback-tutorial7.c**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <gst/gst.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
@ -139,7 +139,7 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
# Walkthrough
|
||||
|
||||
``` first-line: 15; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Create the elements inside the sink bin */
|
||||
equalizer = gst_element_factory_make ("equalizer-3bands", "equalizer");
|
||||
convert = gst_element_factory_make ("audioconvert", "convert");
|
||||
|
@ -155,7 +155,7 @@ All the Elements that compose our sink-bin are instantiated. We use an
|
|||
between, because we are not sure of the capabilities of the audio sink
|
||||
(since they are hardware-dependant).
|
||||
|
||||
``` first-line: 24; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Create the sink bin, add the elements and link them */
|
||||
bin = gst_bin_new ("audio_sink_bin");
|
||||
gst_bin_add_many (GST_BIN (bin), equalizer, convert, sink, NULL);
|
||||
|
@ -165,7 +165,7 @@ gst_element_link_many (equalizer, convert, sink, NULL);
|
|||
This adds the new Elements to the Bin and links them just as we would do
|
||||
if this was a pipeline.
|
||||
|
||||
``` first-line: 28; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
pad = gst_element_get_static_pad (equalizer, "sink");
|
||||
ghost_pad = gst_ghost_pad_new ("sink", pad);
|
||||
gst_pad_set_active (ghost_pad, TRUE);
|
||||
|
@ -194,7 +194,7 @@ with `gst_object_unref()`.
|
|||
At this point, we have a functional sink-bin, which we can use as the
|
||||
audio sink in `playbin2`. We just need to instruct `playbin2` to use it:
|
||||
|
||||
``` first-line: 38; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Set playbin2's audio sink to be our sink bin */
|
||||
g_object_set (GST_OBJECT (pipeline), "audio-sink", bin, NULL);
|
||||
```
|
||||
|
@ -202,7 +202,7 @@ g_object_set (GST_OBJECT (pipeline), "audio-sink", bin, NULL);
|
|||
It is as simple as setting the `audio-sink` property on `playbin2` to
|
||||
the newly created sink.
|
||||
|
||||
``` first-line: 34; theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* Configure the equalizer */
|
||||
g_object_set (G_OBJECT (equalizer), "band1", (gdouble)-24.0, NULL);
|
||||
g_object_set (G_OBJECT (equalizer), "band2", (gdouble)-24.0, NULL);
|
||||
|
@ -243,4 +243,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
[vs2010.zip](attachments/1441842/2424882.zip) (application/zip)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Playback tutorial 8: Hardware-accelerated video decoding
|
||||
# Playback tutorial 8: Hardware-accelerated video decoding
|
||||
|
||||
This page last changed on Jul 24, 2012 by xartigas.
|
||||
|
||||
|
@ -173,7 +173,7 @@ type. Therefore, the easiest way to make sure hardware acceleration is
|
|||
enabled or disabled is by changing the rank of the associated element,
|
||||
as shown in this code:
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
static void enable_factory (const gchar *name, gboolean enable) {
|
||||
GstRegistry *registry = NULL;
|
||||
GstElementFactory *factory = NULL;
|
||||
|
@ -348,4 +348,3 @@ accelerated video decoding. Particularly,
|
|||
It has been a pleasure having you here, and see you soon\!
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Playback tutorial 9: Digital audio pass-through
|
||||
# Playback tutorial 9: Digital audio pass-through
|
||||
|
||||
This page last changed on Jul 24, 2012 by xartigas.
|
||||
|
||||
|
@ -106,4 +106,3 @@ In particular, it has shown that:
|
|||
It has been a pleasure having you here, and see you soon\!
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Playback tutorials
|
||||
# Playback tutorials
|
||||
|
||||
This page last changed on Mar 28, 2012 by xartigas.
|
||||
|
||||
|
@ -8,4 +8,3 @@ These tutorials explain everything you need to know to produce a media
|
|||
playback application using GStreamer.
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Qt tutorials
|
||||
# Qt tutorials
|
||||
|
||||
This page last changed on May 02, 2013 by tdfischer.
|
||||
|
||||
|
@ -16,4 +16,3 @@ previous one and adds progressively more functionality, until a working
|
|||
media player application is obtained in \#FIXME\#
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : QtGStreamer vs C GStreamer
|
||||
# QtGStreamer vs C GStreamer
|
||||
|
||||
This page last changed on May 24, 2013 by xartigas.
|
||||
|
||||
|
@ -65,13 +65,13 @@ with the g\[st\]\_\<class\> prefix removed and converted to camel case.
|
|||
|
||||
For example,
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: false
|
||||
``` lang=c
|
||||
gboolean gst_caps_is_emtpy(const GstCaps *caps);
|
||||
```
|
||||
|
||||
becomes:
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: false
|
||||
``` lang=c
|
||||
namespace QGst {
|
||||
class Caps {
|
||||
bool isEmpty() const;
|
||||
|
@ -104,10 +104,9 @@ to call `g_object_ref()`` and g_object_unref()`.
|
|||
QtGStreamer provides access to the underlying C objects, in case you
|
||||
need them. This is accessible with a simple cast:
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: false
|
||||
``` lang=c
|
||||
ElementPtr qgstElement = QGst::ElementFactory::make("playbin2");
|
||||
GstElement* gstElement = GST_ELEMENT(qgstElement);
|
||||
```
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Releases
|
||||
# Releases
|
||||
|
||||
This page last changed on Jun 12, 2013 by xartigas.
|
||||
|
||||
|
@ -23,4 +23,3 @@ bottom):
|
|||
### [2012.5 Amazon](2012.5%2BAmazon.html)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
77
TODO.markdown
Normal file
77
TODO.markdown
Normal file
|
@ -0,0 +1,77 @@
|
|||
# Todo
|
||||
|
||||
|
||||
This is just a simple TODO list to follow progress of the port from
|
||||
gstreamer.com content to hotdoc
|
||||
|
||||
Pages to review:
|
||||
- Basic+tutorial+6+Media+formats+and+Pad+Capabilities.markdown
|
||||
- iOS+tutorials.markdown
|
||||
- 2012.11+Brahmaputra.markdown
|
||||
- 2012.5+Amazon.markdown
|
||||
- 2012.7+Amazon+%28Bugfix+Release+1%29.markdown
|
||||
- 2012.9+Amazon+%28Bugfix+Release+2%29.markdown
|
||||
- 2013.6+Congo.markdown
|
||||
- Basic+tutorial+7+Multithreading+and+Pad+Availability.markdown
|
||||
- Legal+information.markdown
|
||||
- Basic+tutorial+8+Short-cutting+the+pipeline.markdown
|
||||
- Mac+OS+X+deployment.markdown
|
||||
- Basic+tutorial+9+Media+information+gathering.markdown
|
||||
- Multiplatform+deployment+using+Cerbero.markdown
|
||||
- Basic+tutorials.markdown
|
||||
- Playback+tutorial+1+Playbin2+usage.markdown
|
||||
- Android+tutorial+1+Link+against+GStreamer.markdown
|
||||
- Playback+tutorial+2+Subtitle+management.markdown
|
||||
- Android+tutorial+2+A+running+pipeline.markdown
|
||||
- Contact.markdown
|
||||
- Playback+tutorial+3+Short-cutting+the+pipeline.markdown
|
||||
- Android+tutorial+3+Video.markdown
|
||||
- Deploying+your+application.markdown
|
||||
- Playback+tutorial+4+Progressive+streaming.markdown
|
||||
- Android+tutorial+4+A+basic+media+player.markdown
|
||||
- Frequently+Asked+Questions.markdown
|
||||
- Playback+tutorial+5+Color+Balance.markdown
|
||||
- Android+tutorial+5+A+Complete+media+player.markdown
|
||||
- gst-inspect.markdown
|
||||
- Playback+tutorial+6+Audio+visualization.markdown
|
||||
- Android+tutorials.markdown
|
||||
- gst-launch.markdown
|
||||
- Playback+tutorial+7+Custom+playbin2+sinks.markdown
|
||||
- Basic+Media+Player.markdown
|
||||
- GStreamer+reference.markdown
|
||||
- Playback+tutorial+8+Hardware-accelerated+video+decoding.markdown
|
||||
- Basic+tutorial+10+GStreamer+tools.markdown
|
||||
- Playback+tutorial+9+Digital+audio+pass-through.markdown
|
||||
- Basic+tutorial+11+Debugging+tools.markdown
|
||||
- Playback+tutorials.markdown
|
||||
- Basic+tutorial+12+Streaming.markdown
|
||||
- Installing+for+iOS+development.markdown
|
||||
- Installing+on+Linux.markdown
|
||||
- Installing+on+Mac+OS+X.markdown
|
||||
- Installing+on+Windows.markdown
|
||||
- QtGStreamer+vs+C+GStreamer.markdown
|
||||
- Basic+tutorial+13+Playback+speed.markdown
|
||||
- Qt+tutorials.markdown
|
||||
- Basic+tutorial+14+Handy+elements.markdown
|
||||
- Releases.markdown
|
||||
- Basic+tutorial+15+Clutter+integration.markdown
|
||||
- Basic+tutorial+16+Platform-specific+elements.markdown
|
||||
- Basic+tutorial+1+Hello+world.markdown
|
||||
- iOS+tutorial+1+Link+against+GStreamer.markdown
|
||||
- Basic+tutorial+2+GStreamer+concepts.markdown
|
||||
- iOS+tutorial+2+A+running+pipeline.markdown
|
||||
- Upcoming+tutorials.markdown
|
||||
- Basic+tutorial+3+Dynamic+pipelines.markdown
|
||||
- iOS+tutorial+3+Video.markdown
|
||||
- Using+appsink%2Fappsrc+in+Qt.markdown
|
||||
- Basic+tutorial+4+Time+management.markdown
|
||||
- iOS+tutorial+4+A+basic+media+player.markdown
|
||||
- Windows+deployment.markdown
|
||||
|
||||
Reviewed pages:
|
||||
- Home.markdown
|
||||
- Installing+the+SDK.markdown
|
||||
- Installing+for+Android+development.markdown
|
||||
- Building+from+source+using+Cerbero.markdown
|
||||
- Table+of+Concepts.markdown
|
||||
- Tutorials.markdown
|
|
@ -1,58 +1,46 @@
|
|||
# GStreamer SDK documentation : Table of Concepts
|
||||
|
||||
# Table of Concepts
|
||||
This page last changed on Jun 06, 2012 by xartigas.
|
||||
|
||||
This table shows in which tutorial each of the following key GStreamer
|
||||
concepts is discussed.
|
||||
|
||||
- Action signals: [Playback tutorial 1: Playbin2
|
||||
usage](Playback%2Btutorial%2B1%253A%2BPlaybin2%2Busage.html)
|
||||
- Audio switching: [Playback tutorial 1: Playbin2
|
||||
usage](Playback%2Btutorial%2B1%253A%2BPlaybin2%2Busage.html)
|
||||
- Buffers: [Basic tutorial 8: Short-cutting the
|
||||
pipeline](Basic%2Btutorial%2B8%253A%2BShort-cutting%2Bthe%2Bpipeline.html)
|
||||
- Bus: [Basic tutorial 2: GStreamer
|
||||
concepts](Basic%2Btutorial%2B2%253A%2BGStreamer%2Bconcepts.html)
|
||||
- Capabilities: [Basic tutorial 6: Media formats and Pad
|
||||
Capabilities](Basic%2Btutorial%2B6%253A%2BMedia%2Bformats%2Band%2BPad%2BCapabilities.html)
|
||||
- Debugging: [Basic tutorial 11: Debugging
|
||||
tools](Basic%2Btutorial%2B11%253A%2BDebugging%2Btools.html)
|
||||
- Discoverer: [Basic tutorial 9: Media information
|
||||
gathering](Basic%2Btutorial%2B9%253A%2BMedia%2Binformation%2Bgathering.html)
|
||||
- Elements: [Basic tutorial 2: GStreamer
|
||||
concepts](Basic%2Btutorial%2B2%253A%2BGStreamer%2Bconcepts.html)
|
||||
- gst-discoverer: [Basic tutorial 10: GStreamer
|
||||
tools](Basic%2Btutorial%2B10%253A%2BGStreamer%2Btools.html)
|
||||
- gst-inspect: [Basic tutorial 10: GStreamer
|
||||
tools](Basic%2Btutorial%2B10%253A%2BGStreamer%2Btools.html), [gst-inspect](gst-inspect.html)
|
||||
- gst-launch: [Basic tutorial 10: GStreamer
|
||||
tools](Basic%2Btutorial%2B10%253A%2BGStreamer%2Btools.html), [gst-launch](gst-launch.html)
|
||||
- GUI: [Basic tutorial 5: GUI toolkit
|
||||
integration](Basic%2Btutorial%2B5%253A%2BGUI%2Btoolkit%2Bintegration.html)
|
||||
- Links: [Basic tutorial 2: GStreamer
|
||||
concepts](Basic%2Btutorial%2B2%253A%2BGStreamer%2Bconcepts.html)
|
||||
- Pads: [Basic tutorial 3: Dynamic
|
||||
pipelines](Basic%2Btutorial%2B3%253A%2BDynamic%2Bpipelines.html)
|
||||
- Pad Availability: [Basic tutorial 7: Multithreading and Pad
|
||||
Availability](Basic%2Btutorial%2B7%253A%2BMultithreading%2Band%2BPad%2BAvailability.html)
|
||||
- Pipelines: [Basic tutorial 2: GStreamer
|
||||
concepts](Basic%2Btutorial%2B2%253A%2BGStreamer%2Bconcepts.html)
|
||||
- Queries: [Basic tutorial 4: Time
|
||||
management](Basic%2Btutorial%2B4%253A%2BTime%2Bmanagement.html)
|
||||
- Seeks: [Basic tutorial 4: Time
|
||||
management](Basic%2Btutorial%2B4%253A%2BTime%2Bmanagement.html)
|
||||
- Signals: [Basic tutorial 3: Dynamic
|
||||
pipelines](Basic%2Btutorial%2B3%253A%2BDynamic%2Bpipelines.html)
|
||||
- States: [Basic tutorial 3: Dynamic
|
||||
pipelines](Basic%2Btutorial%2B3%253A%2BDynamic%2Bpipelines.html)
|
||||
- Subtitles: [Playback tutorial 2: Subtitle
|
||||
management](Playback%2Btutorial%2B2%253A%2BSubtitle%2Bmanagement.html)
|
||||
- Tags: [Playback tutorial 1: Playbin2
|
||||
usage](Playback%2Btutorial%2B1%253A%2BPlaybin2%2Busage.html)
|
||||
- Tools: [Basic tutorial 10: GStreamer
|
||||
tools](Basic%2Btutorial%2B10%253A%2BGStreamer%2Btools.html)
|
||||
- Threads: [Basic tutorial 7: Multithreading and Pad
|
||||
Availability](Basic%2Btutorial%2B7%253A%2BMultithreading%2Band%2BPad%2BAvailability.html)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
- Action signals: [Playback tutorial 1: Playbin usage]
|
||||
- Audio switching: [Playback tutorial 1: Playbin usage]
|
||||
- Buffers: [Basic tutorial 8: Short-cutting the pipeline]
|
||||
- Bus: [Basic tutorial 2: GStreamer concepts]
|
||||
- Capabilities: [Basic tutorial 6: Media formats and Pad Capabilities]
|
||||
- Debugging: [Basic tutorial 11: Debugging tools]
|
||||
- Discoverer: [Basic tutorial 9: Media information gathering]
|
||||
- Elements: [Basic tutorial 2: GStreamer concepts]
|
||||
- gst-discoverer: [Basic tutorial 10: GStreamer tools]
|
||||
- gst-inspect: [Basic tutorial 10: GStreamer tools], [gst-inspect]
|
||||
- gst-launch: [Basic tutorial 10: GStreamer tools], [gst-launch]
|
||||
- GUI: [Basic tutorial 5: GUI toolkit integration]
|
||||
- Links: [Basic tutorial 2: GStreamer concepts]
|
||||
- Pads: [Basic tutorial 3: Dynamic pipelines]
|
||||
- Pad Availability: [Basic tutorial 7: Multithreading and Pad
|
||||
Availability]
|
||||
- Pipelines: [Basic tutorial 2: GStreamer concepts]
|
||||
- Queries: [Basic tutorial 4: Time management]
|
||||
- Seeks: [Basic tutorial 4: Time management]
|
||||
- Signals: [Basic tutorial 3: Dynamic pipelines]
|
||||
- States: [Basic tutorial 3: Dynamic pipelines]
|
||||
- Subtitles: [Playback tutorial 2: Subtitle management]
|
||||
- Tags: [Playback tutorial 1: Playbin usage]
|
||||
- Tools: [Basic tutorial 10: GStreamer tools]
|
||||
- Threads: [Basic tutorial 7: Multithreading and Pad Availability]
|
||||
|
||||
[Playback tutorial 1: Playbin usage]: Playback+tutorial+1+Playbin2+usage.markdown
|
||||
[Basic tutorial 8: Short-cutting the pipeline]: Basic+tutorial+8+Short-cutting+the+pipeline.markdown
|
||||
[Basic tutorial 2: GStreamer concepts]: Basic+tutorial+2+GStreamer+concepts.markdown
|
||||
[Basic tutorial 6: Media formats and Pad Capabilities]: Basic+tutorial+6+Media+formats+and+Pad+Capabilities.markdown
|
||||
[Basic tutorial 11: Debugging tools]: Basic+tutorial+11+Debugging+tools.markdown
|
||||
[Basic tutorial 9: Media information gathering]: Basic+tutorial+9+Media+information+gathering.markdown
|
||||
[Basic tutorial 10: GStreamer tools]: Basic+tutorial+10+GStreamer+tools.markdown
|
||||
[gst-inspect]: gst-inspect.markdown
|
||||
[gst-launch]: gst-launch.markdown
|
||||
[Basic tutorial 5: GUI toolkit integration]: Basic+tutorial+5+GUI+toolkit+integration.markdown
|
||||
[Basic tutorial 3: Dynamic pipelines]: Basic+tutorial+3+Dynamic+pipelines.markdown
|
||||
[Basic tutorial 7: Multithreading and Pad Availability]: Basic+tutorial+7+Multithreading+and+Pad+Availability.markdown
|
||||
[Basic tutorial 4: Time management]: Basic+tutorial+4+Time+management.markdown
|
||||
[Playback tutorial 2: Subtitle management]: Playback+tutorial+2+Subtitle+management.markdown
|
||||
|
|
|
@ -9,11 +9,8 @@ open-source, media streaming framework.
|
|||
### Prerequisites
|
||||
|
||||
Before following these tutorials, you need to set up your development
|
||||
environment according to your platform. If you have not done so yet,
|
||||
follow the appropriate link for [Linux](Installing+on+Linux.markdown),
|
||||
[Mac OS X](Installing+on+Mac+OS+X.markdown) or
|
||||
[Windows](Installing+on+Windows.markdown) and come back here
|
||||
afterwards.
|
||||
environment according to your platform. If you have not done so yet, go
|
||||
to the [installing the SDK] page and come back here afterwards.
|
||||
|
||||
The tutorials are currently written only in the C programming language,
|
||||
so you need to be comfortable with it. Even though C is not an
|
||||
|
@ -46,27 +43,25 @@ GObject use `g_`.
|
|||
### Sources of documentation
|
||||
|
||||
You have the `GObject` and `GLib` reference guides, and, of course the
|
||||
upstream [GStreamer
|
||||
documentation](http://gstreamer.freedesktop.org/documentation/).
|
||||
upstream [GStreamer documentation].
|
||||
|
||||
### Structure
|
||||
|
||||
The tutorials are organized in sections, revolving about a common theme:
|
||||
|
||||
- [Basic tutorials](Basic+tutorials.markdown): Describe general topics
|
||||
required to understand the rest of tutorials in the GStreamer SDK.
|
||||
- [Playback tutorials](Playback+tutorials.markdown): Explain everything
|
||||
you need to know to produce a media playback application using
|
||||
GStreamer.
|
||||
- [Android tutorials](Android+tutorials.markdown): Tutorials dealing
|
||||
with the few Android-specific topics you need to know.
|
||||
- [iOS tutorials](iOS+tutorials.markdown): Tutorials dealing with the
|
||||
few iOS-specific topics you need to know.
|
||||
- [Basic tutorials]: Describe general topics required to understand
|
||||
the rest of tutorials in the GStreamer SDK.
|
||||
- [Playback tutorials]: Explain everything you need to know to produce
|
||||
a media playback application using GStreamer.
|
||||
- [Android tutorials]: Tutorials dealing with the few Android-specific
|
||||
topics you need to know.
|
||||
- [iOS tutorials]: Tutorials dealing with the few iOS-specific topics
|
||||
you need to know.
|
||||
|
||||
If you cannot remember in which tutorial a certain GStreamer concept is
|
||||
explained, use the following:
|
||||
|
||||
- [Table of Concepts](Table+of+Concepts.markdown)
|
||||
- [Table of Concepts]
|
||||
|
||||
### Sample media
|
||||
|
||||
|
@ -75,4 +70,13 @@ publicly available and the copyright remains with their respective
|
|||
authors. In some cases they have been re-encoded for demonstration
|
||||
purposes.
|
||||
|
||||
- [Sintel, the Durian Open Movie Project](http://www.sintel.org/)
|
||||
- [Sintel, the Durian Open Movie Project]
|
||||
|
||||
[installing the SDK]: Installing+the+SDK.markdown
|
||||
[GStreamer documentation]: http://gstreamer.freedesktop.org/documentation/
|
||||
[Basic tutorials]: Basic+tutorials.markdown
|
||||
[Playback tutorials]: Playback+tutorials.markdown
|
||||
[Android tutorials]: Android+tutorials.markdown
|
||||
[iOS tutorials]: iOS+tutorials.markdown
|
||||
[Table of Concepts]: Table+of+Concepts.markdown
|
||||
[Sintel, the Durian Open Movie Project]: http://www.sintel.org/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Upcoming tutorials
|
||||
# Upcoming tutorials
|
||||
|
||||
This page last changed on May 24, 2013 by xartigas.
|
||||
|
||||
|
@ -18,4 +18,3 @@ Playback tutorials:
|
|||
- DVD playback
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Using appsink/appsrc in Qt
|
||||
# Using appsink/appsrc in Qt
|
||||
|
||||
This page last changed on May 24, 2013 by xartigas.
|
||||
|
||||
|
@ -24,7 +24,7 @@ First, the files. These are also available in the
|
|||
|
||||
**CMakeLists.txt**
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
project(qtgst-example-appsink-src)
|
||||
find_package(QtGStreamer REQUIRED)
|
||||
find_package(Qt4 REQUIRED)
|
||||
|
@ -37,7 +37,7 @@ target_link_libraries(appsink-src ${QTGSTREAMER_UTILS_LIBRARIES} ${QT_QTCORE_LIB
|
|||
|
||||
**main.cpp**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
#include <iostream>
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QGlib/Error>
|
||||
|
@ -146,7 +146,7 @@ As this is a very simple example, most of the action happens in the
|
|||
|
||||
**GStreamer Initialization**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: false
|
||||
``` lang=c
|
||||
QGst::init(&argc, &argv);
|
||||
```
|
||||
|
||||
|
@ -154,7 +154,7 @@ Now we can construct the first half of the pipeline:
|
|||
|
||||
**Pipeline Setup**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
const char *caps = "audio/x-raw-int,channels=1,rate=8000,"
|
||||
"signed=(boolean)true,width=16,depth=16,endianness=1234";
|
||||
|
||||
|
@ -188,7 +188,7 @@ The second half of the pipeline is created similarly:
|
|||
|
||||
**Second Pipeline**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* sink pipeline */
|
||||
QString pipe2Descr = QString("appsrc name=\"mysrc\" caps=\"%1\" ! autoaudiosink").arg(caps);
|
||||
pipeline2 = QGst::Parse::launch(pipe2Descr).dynamicCast<QGst::Pipeline>();
|
||||
|
@ -201,7 +201,7 @@ Finally, the pipeline is started:
|
|||
|
||||
**Starting the pipeline**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
/* start playing */
|
||||
pipeline1->setState(QGst::StatePlaying);
|
||||
pipeline2->setState(QGst::StatePlaying);
|
||||
|
@ -214,7 +214,7 @@ ready for processing:
|
|||
|
||||
**MySink::newBuffer()**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: true
|
||||
``` lang=c
|
||||
virtual QGst::FlowReturn newBuffer()
|
||||
{
|
||||
m_src->pushBuffer(pullBuffer());
|
||||
|
@ -227,7 +227,7 @@ Our implementation takes the new buffer and pushes it into the
|
|||
|
||||
**Player::Player()**
|
||||
|
||||
``` theme: Default; brush: cpp; gutter: false
|
||||
``` lang=c
|
||||
Player::Player(int argc, char **argv)
|
||||
: QCoreApplication(argc, argv), m_sink(&m_src)
|
||||
```
|
||||
|
@ -243,4 +243,3 @@ data into and out of a GStreamer pipeline.
|
|||
It has been a pleasure having you here, and see you soon\!
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : Windows deployment
|
||||
# Windows deployment
|
||||
|
||||
This page last changed on Nov 28, 2012 by xartigas.
|
||||
|
||||
|
@ -24,7 +24,7 @@ the Windows Installer functionality and offers a number of options to
|
|||
suit your needs. You can review these options by
|
||||
executing `msiexec` without parameters. For example:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
msiexec /i gstreamer-sdk-2012.9-x86.msi
|
||||
```
|
||||
|
||||
|
@ -40,7 +40,7 @@ installer to deploy to your application’s folder (or a
|
|||
subfolder). Again, use the `msiexec` parameters that suit you best. For
|
||||
example:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
msiexec /passive INSTALLDIR=C:\Desired\Folder /i gstreamer-sdk-2012.9-x86.msi
|
||||
```
|
||||
|
||||
|
@ -258,4 +258,3 @@ Get the ZIP file with all Merge Modules for your architecture:
|
|||
</table>
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
3
build.sh
Executable file
3
build.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
hotdoc run
|
||||
cp -R attachments built_doc/html/
|
||||
cp -R images built_doc/html/
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : gst-inspect
|
||||
# gst-inspect
|
||||
|
||||
This page last changed on May 30, 2012 by xartigas.
|
||||
|
||||
|
@ -81,13 +81,13 @@ Add directories separated with ':' to the plugin search path
|
|||
|
||||
## Example
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
gst-inspect-0.10 audiotestsrc
|
||||
```
|
||||
|
||||
should produce:
|
||||
|
||||
``` theme: Default; brush: plain; gutter: false
|
||||
```
|
||||
Factory Details:
|
||||
Long name: Audio test source
|
||||
Class: Source/Audio
|
||||
|
@ -210,4 +210,3 @@ Element Properties:
|
|||
```
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:28
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : gst-launch
|
||||
# gst-launch
|
||||
|
||||
This page last changed on May 30, 2012 by xartigas.
|
||||
|
||||
|
@ -403,4 +403,3 @@ let it core dump). Then get a stack trace in the usual way
|
|||
<!-- end list -->
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:28
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : iOS tutorial 1: Link against GStreamer
|
||||
# iOS tutorial 1: Link against GStreamer
|
||||
|
||||
This page last changed on May 06, 2013 by xartigas.
|
||||
|
||||
|
@ -24,7 +24,7 @@ The UI uses storyboards and contains a single `View` with a centered
|
|||
|
||||
**ViewController.h**
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface ViewController : UIViewController {
|
||||
|
@ -51,7 +51,7 @@ the [Android tutorials](Android%2Btutorials.html).
|
|||
|
||||
**GStreamerBackend.m**
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
#import "GStreamerBackend.h"
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
@ -85,7 +85,7 @@ GStreamer version to display at the label. That's it\!
|
|||
|
||||
**ViewController.m**
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
#import "ViewController.h"
|
||||
#import "GStreamerBackend.h"
|
||||
|
||||
|
@ -144,4 +144,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
(image/png)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : iOS tutorial 2: A running pipeline
|
||||
# iOS tutorial 2: A running pipeline
|
||||
|
||||
This page last changed on May 13, 2013 by xartigas.
|
||||
|
||||
|
@ -60,7 +60,7 @@ behalf:
|
|||
|
||||
**ViewController.m**
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
#import "ViewController.h"
|
||||
#import "GStreamerBackend.h"
|
||||
#import <UIKit/UIKit.h>
|
||||
|
@ -130,7 +130,7 @@ behalf:
|
|||
|
||||
An instance of the `GStreamerBackend` in stored inside the class:
|
||||
|
||||
``` first-line: 5; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
@interface ViewController () {
|
||||
GStreamerBackend *gst_backend;
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ An instance of the `GStreamerBackend` in stored inside the class:
|
|||
This instance is created in the `viewDidLoad` function through a custom
|
||||
`init:` method in the `GStreamerBackend`:
|
||||
|
||||
``` first-line: 17; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
@ -158,7 +158,7 @@ The Play and Pause buttons are also disabled in the
|
|||
`viewDidLoad` function, and they are not re-enabled until the
|
||||
`GStreamerBackend` reports that it is initialized and ready.
|
||||
|
||||
``` first-line: 33; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Called when the Play button is pressed */
|
||||
-(IBAction) play:(id)sender
|
||||
{
|
||||
|
@ -176,7 +176,7 @@ These two methods are called when the user presses the Play or Pause
|
|||
buttons, and simply forward the call to the appropriate method in the
|
||||
`GStreamerBackend`.
|
||||
|
||||
``` first-line: 49; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
-(void) gstreamerInitialized
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
@ -196,7 +196,7 @@ the
|
|||
[dispatch\_async()](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/dispatch_async.3.html) call
|
||||
wrapping all UI code.
|
||||
|
||||
``` first-line: 58; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
-(void) gstreamerSetUIMessage:(NSString *)message
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
@ -221,7 +221,7 @@ the `GStreamerBackendDelegate` protocol:
|
|||
|
||||
**GStreamerBackend.m**
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
#import "GStreamerBackend.h"
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
@ -404,7 +404,7 @@ static void state_changed_cb (GstBus *bus, GstMessage *msg, GStreamerBackend *se
|
|||
|
||||
#### Interface methods:
|
||||
|
||||
``` first-line: 26; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
-(id) init:(id) uiDelegate
|
||||
{
|
||||
if (self = [super init])
|
||||
|
@ -434,7 +434,7 @@ warns the application when interesting things happen.
|
|||
threshold, so we can see the debug output from within Xcode and keep
|
||||
track of our application progress.
|
||||
|
||||
``` first-line: 44; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
-(void) dealloc
|
||||
{
|
||||
if (pipeline) {
|
||||
|
@ -449,7 +449,7 @@ track of our application progress.
|
|||
The `dealloc` method takes care of bringing the pipeline to the NULL
|
||||
state and releasing it.
|
||||
|
||||
``` first-line: 54; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
-(void) play
|
||||
{
|
||||
if(gst_element_set_state(pipeline, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) {
|
||||
|
@ -470,7 +470,7 @@ desired state and warn the application if something fails.
|
|||
|
||||
#### Private methods:
|
||||
|
||||
``` first-line: 72; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Change the message on the UI through the UI delegate */
|
||||
-(void)setUIMessage:(gchar*) message
|
||||
{
|
||||
|
@ -488,7 +488,7 @@ into `NSString *` and displays them through the
|
|||
implementation of this method is marked as `@optional`, and hence the
|
||||
check for its existence in the delegate with `respondsToSelector:`
|
||||
|
||||
``` first-line: 82; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Retrieve errors from the bus and show them on the UI */
|
||||
static void error_cb (GstBus *bus, GstMessage *msg, GStreamerBackend *self)
|
||||
{
|
||||
|
@ -534,7 +534,7 @@ through the `userdata` pointer of the callbacks (the `self` pointer in
|
|||
these implementations). This is discussed below when registering the
|
||||
callbacks in the `app_function`.
|
||||
|
||||
``` first-line: 111; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Check if all conditions are met to report GStreamer as initialized.
|
||||
* These conditions will change depending on the application */
|
||||
-(void) check_initialization_complete
|
||||
|
@ -562,7 +562,7 @@ It exists with almost identical content in the Android tutorial, which
|
|||
exemplifies how the same code can run on both platforms with little
|
||||
change.
|
||||
|
||||
``` first-line: 134; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Create our own GLib Main Context and make it the default one */
|
||||
context = g_main_context_new ();
|
||||
g_main_context_push_thread_default(context);
|
||||
|
@ -574,7 +574,7 @@ libraries which might not have been properly disposed of. A new context
|
|||
is created with `g_main_context_new()` and then it is made the default
|
||||
one for the thread with `g_main_context_push_thread_default()`.
|
||||
|
||||
``` first-line: 138; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Build pipeline */
|
||||
pipeline = gst_parse_launch("audiotestsrc ! audioconvert ! audioresample ! autoaudiosink", &error);
|
||||
if (error) {
|
||||
|
@ -591,7 +591,7 @@ this case, it is simply an `audiotestsrc` (which produces a continuous
|
|||
tone) and an `autoaudiosink`, with accompanying adapter
|
||||
elements.
|
||||
|
||||
``` first-line: 148; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Instruct the bus to emit signals for each received message, and connect to the interesting signals */
|
||||
bus = gst_element_get_bus (pipeline);
|
||||
bus_source = gst_bus_create_watch (bus);
|
||||
|
@ -616,7 +616,7 @@ because it travels through C-land untouched. It re-emerges at the
|
|||
different callbacks through the userdata pointer and cast again to a
|
||||
`GStreamerBackend *`.
|
||||
|
||||
``` first-line: 158; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Create a GLib Main Loop and set it to run */
|
||||
GST_DEBUG ("Entering main loop...");
|
||||
main_loop = g_main_loop_new (context, FALSE);
|
||||
|
@ -665,4 +665,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
(image/png)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : iOS tutorial 3: Video
|
||||
# iOS tutorial 3: Video
|
||||
|
||||
This page last changed on May 13, 2013 by xartigas.
|
||||
|
||||
|
@ -41,7 +41,7 @@ outlets):
|
|||
|
||||
**ViewController.h**
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "GStreamerBackendDelegate.h"
|
||||
|
||||
|
@ -73,7 +73,7 @@ behalf:
|
|||
|
||||
**ViewController.m**
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
#import "ViewController.h"
|
||||
#import "GStreamerBackend.h"
|
||||
#import <UIKit/UIKit.h>
|
||||
|
@ -167,7 +167,7 @@ behalf:
|
|||
We expand the class to remember the width and height of the media we are
|
||||
currently playing:
|
||||
|
||||
``` first-line: 5; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
@interface ViewController () {
|
||||
GStreamerBackend *gst_backend;
|
||||
int media_width;
|
||||
|
@ -179,7 +179,7 @@ In later tutorials this data is retrieved from the GStreamer pipeline,
|
|||
but in this tutorial, for simplicity’s sake, the width and height of the
|
||||
media is constant and initialized in `viewDidLoad`:
|
||||
|
||||
``` first-line: 19; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
@ -203,7 +203,7 @@ The rest of the `ViewController `code is the same as the previous
|
|||
tutorial, except for the code that adapts the `video_view` size to the
|
||||
media size, respecting its aspect ratio:
|
||||
|
||||
``` first-line: 51; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
- (void)viewDidLayoutSubviews
|
||||
{
|
||||
CGFloat view_width = video_container_view.bounds.size.width;
|
||||
|
@ -250,7 +250,7 @@ the `GStreamerBackendDelegate` protocol:
|
|||
|
||||
**GStreamerBackend.m**
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
#import "GStreamerBackend.h"
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
@ -446,7 +446,7 @@ static void state_changed_cb (GstBus *bus, GstMessage *msg, GStreamerBackend *se
|
|||
The main differences with the previous tutorial are related to the
|
||||
handling of the `XOverlay` interface:
|
||||
|
||||
``` first-line: 15; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
@implementation GStreamerBackend {
|
||||
id ui_delegate; /* Class that we use to interact with the user interface */
|
||||
GstElement *pipeline; /* The running pipeline */
|
||||
|
@ -461,7 +461,7 @@ handling of the `XOverlay` interface:
|
|||
The class is expanded to keep track of the video sink element in the
|
||||
pipeline and the `UIView *` onto which rendering is to occur.
|
||||
|
||||
``` first-line: 29; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
-(id) init:(id) uiDelegate videoView:(UIView *)video_view
|
||||
{
|
||||
if (self = [super init])
|
||||
|
@ -485,7 +485,7 @@ pipeline and the `UIView *` onto which rendering is to occur.
|
|||
The constructor accepts the `UIView *` as a new parameter, which, at
|
||||
this point, is simply remembered in `ui_video_view`.
|
||||
|
||||
``` first-line: 142; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Build pipeline */
|
||||
pipeline = gst_parse_launch("videotestsrc ! warptv ! ffmpegcolorspace ! autovideosink", &error);
|
||||
```
|
||||
|
@ -497,7 +497,7 @@ choses the appropriate sink for the platform (currently,
|
|||
`eglglessink` is the only option for
|
||||
iOS).
|
||||
|
||||
``` first-line: 152; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Set the pipeline to READY, so it can already accept a window handle */
|
||||
gst_element_set_state(pipeline, GST_STATE_READY);
|
||||
|
||||
|
@ -541,14 +541,13 @@ To this avail, we create the `EaglUIView` class, derived from
|
|||
|
||||
**EaglUIView.m**
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
#import "EaglUIVIew.h"
|
||||
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
@implementation EaglUIView
|
||||
|
||||
|
||||
+ (Class) layerClass
|
||||
{
|
||||
return [CAEAGLLayer class];
|
||||
|
@ -586,4 +585,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
(image/png)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : iOS tutorial 4: A basic media player
|
||||
# iOS tutorial 4: A basic media player
|
||||
|
||||
This page last changed on May 21, 2013 by xartigas.
|
||||
|
||||
|
@ -52,7 +52,7 @@ duration.
|
|||
|
||||
**VideoViewController.h**
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "GStreamerBackendDelegate.h"
|
||||
|
||||
|
@ -101,7 +101,7 @@ this view is collapsed by default. Click here to expand…
|
|||
|
||||
**VideoViewController.m**
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
#import "VideoViewController.h"
|
||||
#import "GStreamerBackend.h"
|
||||
#import <UIKit/UIKit.h>
|
||||
|
@ -311,7 +311,7 @@ because we will not offer the same functionalities. We keep track of
|
|||
this in the `is_local_media` variable, which is set when the URI is set,
|
||||
in the `gstreamerInitialized` method:
|
||||
|
||||
``` first-line: 154; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
-(void) gstreamerInitialized
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
@ -331,7 +331,7 @@ Every time the size of the media changes (which could happen mid-stream,
|
|||
for some kind of streams), or when it is first detected,
|
||||
`GStreamerBackend` calls our `mediaSizeChanged()` callback:
|
||||
|
||||
``` first-line: 173; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
-(void) mediaSizeChanged:(NSInteger)width height:(NSInteger)height
|
||||
{
|
||||
media_width = width;
|
||||
|
@ -370,7 +370,7 @@ call our `setCurrentPosition` method so we can update the position of
|
|||
the thumb in the Seek Bar. Again we do so from the UI thread, using
|
||||
`dispatch_async()`.
|
||||
|
||||
``` first-line: 184; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
-(void) setCurrentPosition:(NSInteger)position duration:(NSInteger)duration
|
||||
{
|
||||
/* Ignore messages from the pipeline if the time sliders is being dragged */
|
||||
|
@ -397,7 +397,7 @@ which we will use to display the current position and duration in
|
|||
takes care of it, and must be called every time the Seek Bar is
|
||||
updated:
|
||||
|
||||
``` first-line: 24; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* 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
|
||||
|
@ -438,7 +438,7 @@ outlets are connected. We will be notified when the user starts dragging
|
|||
the Slider, when the Slider position changes and when the users releases
|
||||
the Slider.
|
||||
|
||||
``` first-line: 112; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Called when the user starts to drag the time slider */
|
||||
- (IBAction)sliderTouchDown:(id)sender {
|
||||
[gst_backend pause];
|
||||
|
@ -452,7 +452,7 @@ do not want it to keep moving. We also mark that a drag operation is in
|
|||
progress in the
|
||||
`dragging_slider` variable.
|
||||
|
||||
``` first-line: 102; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* 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 {
|
||||
|
@ -475,7 +475,7 @@ Otherwise, the seek operation will be performed when the thumb is
|
|||
released, and the only thing we do here is update the textual time
|
||||
widget.
|
||||
|
||||
``` first-line: 118; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Called when the user stops dragging the time slider */
|
||||
- (IBAction)sliderTouchUp:(id)sender {
|
||||
dragging_slider = NO;
|
||||
|
@ -509,7 +509,7 @@ this view is collapsed by default. Click here to expand…
|
|||
|
||||
**GStreamerBackend.m**
|
||||
|
||||
``` theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
#import "GStreamerBackend.h"
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
@ -911,7 +911,7 @@ The UI code will call `setUri` whenever it wants to change the playing
|
|||
URI (in this tutorial the URI never changes, but it does in the next
|
||||
one):
|
||||
|
||||
``` first-line: 79; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
-(void) setUri:(NSString*)uri
|
||||
{
|
||||
const char *char_uri = [uri UTF8String];
|
||||
|
@ -934,7 +934,7 @@ do not. Therefore, in the READY to PAUSED state change, once the Caps of
|
|||
the decoded media are known, we inspect them
|
||||
in `check_media_size()`:
|
||||
|
||||
``` first-line: 244; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Retrieve the video sink's Caps and tell the application about the media size */
|
||||
static void check_media_size (GStreamerBackend *self) {
|
||||
GstElement *video_sink;
|
||||
|
@ -988,7 +988,7 @@ To keep the UI updated, a GLib timer is installed in
|
|||
the `app_function` that fires 4 times per second (or every 250ms),
|
||||
right before entering the main loop:
|
||||
|
||||
``` first-line: 365; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Register a function that GLib will call 4 times per second */
|
||||
timeout_source = g_timeout_source_new (250);
|
||||
g_source_set_callback (timeout_source, (GSourceFunc)refresh_ui, (__bridge void *)self, NULL);
|
||||
|
@ -999,7 +999,7 @@ right before entering the main loop:
|
|||
Then, in the refresh\_ui
|
||||
method:
|
||||
|
||||
``` first-line: 120; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* If we have pipeline and it is running, query the current position and clip duration and inform
|
||||
* the application */
|
||||
static gboolean refresh_ui (GStreamerBackend *self) {
|
||||
|
@ -1051,7 +1051,7 @@ see how to overcome these problems.
|
|||
|
||||
In `setPosition`:
|
||||
|
||||
``` first-line: 86; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
-(void) setPosition:(NSInteger)milliseconds
|
||||
{
|
||||
gint64 position = (gint64)(milliseconds * GST_MSECOND);
|
||||
|
@ -1069,7 +1069,7 @@ away; otherwise, store the desired position in
|
|||
the `desired_position` variable. Then, in
|
||||
the `state_changed_cb()` callback:
|
||||
|
||||
``` first-line: 292; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
if (old_state == GST_STATE_READY && new_state == GST_STATE_PAUSED)
|
||||
{
|
||||
check_media_size(self);
|
||||
|
@ -1105,7 +1105,7 @@ once this period elapses.
|
|||
To achieve this, all seek requests are routed through
|
||||
the `execute_seek()` method:
|
||||
|
||||
``` first-line: 145; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Perform seek, if we are not too close to the previous seek. Otherwise, schedule the seek for
|
||||
* some time in the future. */
|
||||
static void execute_seek (gint64 position, GStreamerBackend *self) {
|
||||
|
@ -1176,7 +1176,7 @@ using buffering. The same procedure is used here, by listening to the
|
|||
buffering
|
||||
messages:
|
||||
|
||||
``` first-line: 361; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
g_signal_connect (G_OBJECT (bus), "message::buffering", (GCallback)buffering_cb, (__bridge void *)self);
|
||||
```
|
||||
|
||||
|
@ -1186,7 +1186,7 @@ source):
|
|||
|
||||
|
||||
|
||||
``` first-line: 215; theme: Default; brush: plain; gutter: true
|
||||
```
|
||||
/* Called when buffering messages are received. We inform the UI about the current buffering level and
|
||||
* keep the pipeline paused until 100% buffering is reached. At that point, set the desired state. */
|
||||
static void buffering_cb (GstBus *bus, GstMessage *msg, GStreamerBackend *self) {
|
||||
|
@ -1239,4 +1239,3 @@ here into an acceptable iOS media player.
|
|||
(image/png)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : iOS tutorial 5: A Complete media player
|
||||
# iOS tutorial 5: A Complete media player
|
||||
|
||||
This page last changed on May 22, 2013 by
|
||||
xartigas.
|
||||
|
@ -75,4 +75,3 @@ It has been a pleasure having you here, and see you soon\!
|
|||
(image/png)
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# GStreamer SDK documentation : iOS tutorials
|
||||
# iOS tutorials
|
||||
|
||||
This page last changed on May 07, 2013 by xartigas.
|
||||
|
||||
|
@ -36,4 +36,3 @@ All iOS tutorials are split into the following classes:
|
|||
`GStreamerBackend`.
|
||||
|
||||
Document generated by Confluence on Oct 08, 2015 10:27
|
||||
|
||||
|
|
BIN
images/icons/bullet_blue.gif
Normal file
BIN
images/icons/bullet_blue.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 60 B |
BIN
images/icons/contenttypes/comment_16.png
Normal file
BIN
images/icons/contenttypes/comment_16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
images/icons/contenttypes/home_page_16.png
Normal file
BIN
images/icons/contenttypes/home_page_16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 53 KiB |
BIN
images/icons/grey_arrow_down.gif
Normal file
BIN
images/icons/grey_arrow_down.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 61 B |
Loading…
Reference in a new issue