├── C
├── .gitignore
├── multifilesink.c
├── takepic.c
└── zoom.c
├── CONTRIBUTORS.md
├── Other
└── 0.10
│ ├── C
│ ├── gst-sdk-tutorials
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── README.md~
│ │ ├── android-tutorial-1
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── jni
│ │ │ │ ├── Android.mk
│ │ │ │ └── tutorial-1.c
│ │ │ ├── res
│ │ │ │ ├── drawable-hdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-ldpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── layout
│ │ │ │ │ └── main.xml
│ │ │ │ └── values
│ │ │ │ │ └── strings.xml
│ │ │ └── src
│ │ │ │ └── com
│ │ │ │ └── gst_sdk_tutorials
│ │ │ │ └── tutorial_1
│ │ │ │ └── Tutorial1.java
│ │ ├── android-tutorial-2
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── jni
│ │ │ │ ├── Android.mk
│ │ │ │ └── tutorial-2.c
│ │ │ ├── res
│ │ │ │ ├── drawable-hdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-ldpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── layout
│ │ │ │ │ └── main.xml
│ │ │ │ └── values
│ │ │ │ │ └── strings.xml
│ │ │ └── src
│ │ │ │ └── com
│ │ │ │ └── gst_sdk_tutorials
│ │ │ │ └── tutorial_2
│ │ │ │ └── Tutorial2.java
│ │ ├── android-tutorial-3
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── jni
│ │ │ │ ├── Android.mk
│ │ │ │ └── tutorial-3.c
│ │ │ ├── res
│ │ │ │ ├── drawable-hdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-ldpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── layout
│ │ │ │ │ └── main.xml
│ │ │ │ └── values
│ │ │ │ │ └── strings.xml
│ │ │ └── src
│ │ │ │ └── com
│ │ │ │ └── gst_sdk_tutorials
│ │ │ │ └── tutorial_3
│ │ │ │ ├── GStreamerSurfaceView.java
│ │ │ │ └── Tutorial3.java
│ │ ├── android-tutorial-4
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── jni
│ │ │ │ ├── Android.mk
│ │ │ │ └── tutorial-4.c
│ │ │ ├── res
│ │ │ │ ├── drawable-hdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-ldpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── layout
│ │ │ │ │ └── main.xml
│ │ │ │ └── values
│ │ │ │ │ └── strings.xml
│ │ │ └── src
│ │ │ │ └── com
│ │ │ │ └── gst_sdk_tutorials
│ │ │ │ └── tutorial_4
│ │ │ │ ├── GStreamerSurfaceView.java
│ │ │ │ └── Tutorial4.java
│ │ ├── android-tutorial-5
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── jni
│ │ │ │ ├── Android.mk
│ │ │ │ └── tutorial-5.c
│ │ │ ├── res
│ │ │ │ ├── drawable-hdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-ldpi
│ │ │ │ │ ├── file.png
│ │ │ │ │ ├── folder.png
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ │ └── gst_sdk_icon.png
│ │ │ │ ├── layout
│ │ │ │ │ ├── file_dialog_main.xml
│ │ │ │ │ ├── file_dialog_row.xml
│ │ │ │ │ └── main.xml
│ │ │ │ └── values
│ │ │ │ │ └── strings.xml
│ │ │ └── src
│ │ │ │ └── com
│ │ │ │ ├── gst_sdk_tutorials
│ │ │ │ └── tutorial_5
│ │ │ │ │ ├── GStreamerSurfaceView.java
│ │ │ │ │ └── Tutorial5.java
│ │ │ │ └── lamerman
│ │ │ │ └── FileDialog.java
│ │ ├── basic-tutorial-1.c
│ │ ├── basic-tutorial-12.c
│ │ ├── basic-tutorial-13.c
│ │ ├── basic-tutorial-15.c
│ │ ├── basic-tutorial-2.c
│ │ ├── basic-tutorial-3.c
│ │ ├── basic-tutorial-4.c
│ │ ├── basic-tutorial-5.c
│ │ ├── basic-tutorial-6.c
│ │ ├── basic-tutorial-7.c
│ │ ├── basic-tutorial-8.c
│ │ ├── basic-tutorial-9.c
│ │ ├── playback-tutorial-1.c
│ │ ├── playback-tutorial-2.c
│ │ ├── playback-tutorial-3.c
│ │ ├── playback-tutorial-4.c
│ │ ├── playback-tutorial-5.c
│ │ ├── playback-tutorial-6.c
│ │ ├── playback-tutorial-7.c
│ │ ├── vs2010
│ │ │ ├── basic-tutorial-1
│ │ │ │ ├── basic-tutorial-1.vcxproj
│ │ │ │ └── basic-tutorial-1.vcxproj.filters
│ │ │ ├── basic-tutorial-12
│ │ │ │ ├── basic-tutorial-12.vcxproj
│ │ │ │ └── basic-tutorial-12.vcxproj.filters
│ │ │ ├── basic-tutorial-13
│ │ │ │ ├── basic-tutorial-13.vcxproj
│ │ │ │ └── basic-tutorial-13.vcxproj.filters
│ │ │ ├── basic-tutorial-15
│ │ │ │ ├── basic-tutorial-15.vcxproj
│ │ │ │ └── basic-tutorial-15.vcxproj.filters
│ │ │ ├── basic-tutorial-2
│ │ │ │ ├── basic-tutorial-2.vcxproj
│ │ │ │ └── basic-tutorial-2.vcxproj.filters
│ │ │ ├── basic-tutorial-3
│ │ │ │ ├── basic-tutorial-3.vcxproj
│ │ │ │ └── basic-tutorial-3.vcxproj.filters
│ │ │ ├── basic-tutorial-4
│ │ │ │ ├── basic-tutorial-4.vcxproj
│ │ │ │ └── basic-tutorial-4.vcxproj.filters
│ │ │ ├── basic-tutorial-5
│ │ │ │ ├── basic-tutorial-5.vcxproj
│ │ │ │ └── basic-tutorial-5.vcxproj.filters
│ │ │ ├── basic-tutorial-6
│ │ │ │ ├── basic-tutorial-6.vcxproj
│ │ │ │ └── basic-tutorial-6.vcxproj.filters
│ │ │ ├── basic-tutorial-7
│ │ │ │ ├── basic-tutorial-7.vcxproj
│ │ │ │ └── basic-tutorial-7.vcxproj.filters
│ │ │ ├── basic-tutorial-8
│ │ │ │ ├── basic-tutorial-8.vcxproj
│ │ │ │ └── basic-tutorial-8.vcxproj.filters
│ │ │ ├── basic-tutorial-9
│ │ │ │ ├── basic-tutorial-9.vcxproj
│ │ │ │ └── basic-tutorial-9.vcxproj.filters
│ │ │ ├── playback-tutorial-1
│ │ │ │ ├── playback-tutorial-1.vcxproj
│ │ │ │ └── playback-tutorial-1.vcxproj.filters
│ │ │ ├── playback-tutorial-2
│ │ │ │ ├── playback-tutorial-2.vcxproj
│ │ │ │ └── playback-tutorial-2.vcxproj.filters
│ │ │ ├── playback-tutorial-3
│ │ │ │ ├── playback-tutorial-3.vcxproj
│ │ │ │ └── playback-tutorial-3.vcxproj.filters
│ │ │ ├── playback-tutorial-4
│ │ │ │ ├── playback-tutorial-4.vcxproj
│ │ │ │ └── playback-tutorial-4.vcxproj.filters
│ │ │ ├── playback-tutorial-5
│ │ │ │ ├── playback-tutorial-5.vcxproj
│ │ │ │ └── playback-tutorial-5.vcxproj.filters
│ │ │ ├── playback-tutorial-6
│ │ │ │ ├── playback-tutorial-6.vcxproj
│ │ │ │ └── playback-tutorial-6.vcxproj.filters
│ │ │ ├── playback-tutorial-7
│ │ │ │ ├── playback-tutorial-7.vcxproj
│ │ │ │ └── playback-tutorial-7.vcxproj.filters
│ │ │ └── tutorials.sln
│ │ ├── xcode iOS
│ │ │ ├── GStreamer iOS Tutorials.xcodeproj
│ │ │ │ ├── project.pbxproj
│ │ │ │ └── project.xcworkspace
│ │ │ │ │ └── contents.xcworkspacedata
│ │ │ ├── Tutorial 1
│ │ │ │ ├── AppDelegate.h
│ │ │ │ ├── AppDelegate.m
│ │ │ │ ├── Default-568h@2x.png
│ │ │ │ ├── Default.png
│ │ │ │ ├── Default@2x.png
│ │ │ │ ├── GStreamerBackend.h
│ │ │ │ ├── GStreamerBackend.m
│ │ │ │ ├── Images
│ │ │ │ │ ├── appicon-1-iPad.png
│ │ │ │ │ ├── appicon-1-iPad@2x.png
│ │ │ │ │ ├── appicon-1-iPhone.png
│ │ │ │ │ └── appicon-1-iPhone@2x.png
│ │ │ │ ├── Tutorial 1-Info.plist
│ │ │ │ ├── Tutorial 1-Prefix.pch
│ │ │ │ ├── Ubuntu-R.ttf
│ │ │ │ ├── ViewController.h
│ │ │ │ ├── ViewController.m
│ │ │ │ ├── en.lproj
│ │ │ │ │ ├── InfoPlist.strings
│ │ │ │ │ ├── MainStoryboard_iPad.storyboard
│ │ │ │ │ └── MainStoryboard_iPhone.storyboard
│ │ │ │ ├── fonts.conf
│ │ │ │ ├── gst_ios_init.h
│ │ │ │ ├── gst_ios_init.m
│ │ │ │ └── main.m
│ │ │ ├── Tutorial 2
│ │ │ │ ├── AppDelegate.h
│ │ │ │ ├── AppDelegate.m
│ │ │ │ ├── Default-568h@2x.png
│ │ │ │ ├── Default.png
│ │ │ │ ├── Default@2x.png
│ │ │ │ ├── GStreamerBackend.h
│ │ │ │ ├── GStreamerBackend.m
│ │ │ │ ├── GStreamerBackendDelegate.h
│ │ │ │ ├── Images
│ │ │ │ │ ├── appicon-2-iPad.png
│ │ │ │ │ ├── appicon-2-iPad@2x.png
│ │ │ │ │ ├── appicon-2-iPhone.png
│ │ │ │ │ └── appicon-2-iPhone@2x.png
│ │ │ │ ├── Tutorial 2-Info.plist
│ │ │ │ ├── Tutorial 2-Prefix.pch
│ │ │ │ ├── Tutorial2-Info.plist
│ │ │ │ ├── Ubuntu-R.ttf
│ │ │ │ ├── ViewController.h
│ │ │ │ ├── ViewController.m
│ │ │ │ ├── en.lproj
│ │ │ │ │ ├── InfoPlist.strings
│ │ │ │ │ ├── MainStoryboard_iPad.storyboard
│ │ │ │ │ └── MainStoryboard_iPhone.storyboard
│ │ │ │ ├── fonts.conf
│ │ │ │ ├── gst_ios_init.h
│ │ │ │ ├── gst_ios_init.m
│ │ │ │ └── main.m
│ │ │ ├── Tutorial 3
│ │ │ │ ├── AppDelegate.h
│ │ │ │ ├── AppDelegate.m
│ │ │ │ ├── Default-568h@2x.png
│ │ │ │ ├── Default.png
│ │ │ │ ├── Default@2x.png
│ │ │ │ ├── EaglUIVIew.h
│ │ │ │ ├── EaglUIVIew.m
│ │ │ │ ├── GStreamerBackend.h
│ │ │ │ ├── GStreamerBackend.m
│ │ │ │ ├── GStreamerBackendDelegate.h
│ │ │ │ ├── Images
│ │ │ │ │ ├── appicon-3-iPad.png
│ │ │ │ │ ├── appicon-3-iPad@2x.png
│ │ │ │ │ ├── appicon-3-iPhone.png
│ │ │ │ │ └── appicon-3-iPhone@2x.png
│ │ │ │ ├── Tutorial 3-Info.plist
│ │ │ │ ├── Tutorial 3-Prefix.pch
│ │ │ │ ├── Ubuntu-R.ttf
│ │ │ │ ├── ViewController.h
│ │ │ │ ├── ViewController.m
│ │ │ │ ├── en.lproj
│ │ │ │ │ ├── InfoPlist.strings
│ │ │ │ │ ├── MainStoryboard_iPad.storyboard
│ │ │ │ │ └── MainStoryboard_iPhone.storyboard
│ │ │ │ ├── fonts.conf
│ │ │ │ ├── gst_ios_init.h
│ │ │ │ ├── gst_ios_init.m
│ │ │ │ └── main.m
│ │ │ ├── Tutorial 4
│ │ │ │ ├── AppDelegate.h
│ │ │ │ ├── AppDelegate.m
│ │ │ │ ├── Default-568h@2x.png
│ │ │ │ ├── Default.png
│ │ │ │ ├── Default@2x.png
│ │ │ │ ├── EaglUIVIew.h
│ │ │ │ ├── EaglUIVIew.m
│ │ │ │ ├── GStreamerBackend.h
│ │ │ │ ├── GStreamerBackend.m
│ │ │ │ ├── GStreamerBackendDelegate.h
│ │ │ │ ├── Images
│ │ │ │ │ ├── appicon-4-iPad.png
│ │ │ │ │ ├── appicon-4-iPad@2x.png
│ │ │ │ │ ├── appicon-4-iPhone.png
│ │ │ │ │ └── appicon-4-iPhone@2x.png
│ │ │ │ ├── Tutorial 4-Info.plist
│ │ │ │ ├── Tutorial 4-Prefix.pch
│ │ │ │ ├── Ubuntu-R.ttf
│ │ │ │ ├── VideoViewController.h
│ │ │ │ ├── VideoViewController.m
│ │ │ │ ├── en.lproj
│ │ │ │ │ ├── InfoPlist.strings
│ │ │ │ │ ├── MainStoryboard_iPad.storyboard
│ │ │ │ │ └── MainStoryboard_iPhone.storyboard
│ │ │ │ ├── fonts.conf
│ │ │ │ ├── gst_ios_init.h
│ │ │ │ ├── gst_ios_init.m
│ │ │ │ └── main.m
│ │ │ └── Tutorial 5
│ │ │ │ ├── AppDelegate.h
│ │ │ │ ├── AppDelegate.m
│ │ │ │ ├── Default-568h@2x.png
│ │ │ │ ├── Default.png
│ │ │ │ ├── Default@2x.png
│ │ │ │ ├── EaglUIVIew.h
│ │ │ │ ├── EaglUIVIew.m
│ │ │ │ ├── GStreamerBackend.h
│ │ │ │ ├── GStreamerBackend.m
│ │ │ │ ├── GStreamerBackendDelegate.h
│ │ │ │ ├── Images
│ │ │ │ ├── appicon-5-iPad.png
│ │ │ │ ├── appicon-5-iPad@2x.png
│ │ │ │ ├── appicon-5-iPhone.png
│ │ │ │ └── appicon-5-iPhone@2x.png
│ │ │ │ ├── LibraryViewController.h
│ │ │ │ ├── LibraryViewController.m
│ │ │ │ ├── Tutorial 5-Info.plist
│ │ │ │ ├── Tutorial 5-Prefix.pch
│ │ │ │ ├── Ubuntu-R.ttf
│ │ │ │ ├── VideoViewController.h
│ │ │ │ ├── VideoViewController.m
│ │ │ │ ├── en.lproj
│ │ │ │ ├── InfoPlist.strings
│ │ │ │ ├── MainStoryboard_iPad.storyboard
│ │ │ │ └── MainStoryboard_iPhone.storyboard
│ │ │ │ ├── fonts.conf
│ │ │ │ ├── gst_ios_init.h
│ │ │ │ ├── gst_ios_init.m
│ │ │ │ └── main.m
│ │ └── xcode
│ │ │ └── GStreamer Tutorials.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ ├── 01-Tutorial 1.xcscheme
│ │ │ ├── 02-Tutorial 2.xcscheme
│ │ │ ├── 03-Turorial 3.xcscheme
│ │ │ ├── 04-Tutorial 4.xcscheme
│ │ │ ├── 05-Tutorial 5.xcscheme
│ │ │ ├── 06-Tutorial 6.xcscheme
│ │ │ ├── 07-Tutorial 7.xcscheme
│ │ │ ├── 08-Tutorial 8.xcscheme
│ │ │ ├── 09-Tutorial 9.xcscheme
│ │ │ ├── 12-Tutorial 12.xcscheme
│ │ │ ├── 13-Tutorial 13.xcscheme
│ │ │ ├── 15-Tutorial 15.xcscheme
│ │ │ ├── 21-Playback Tutorial 1.xcscheme
│ │ │ ├── 22-Playback Tutorial 2.xcscheme
│ │ │ ├── 23-Playback Tutorial 3.xcscheme
│ │ │ ├── 24-Playback Tutorial 4.xcscheme
│ │ │ ├── 25-Playback Tutorial 5.xcscheme
│ │ │ ├── 26-Playback Tutorial 6.xcscheme
│ │ │ ├── 27-Playback Tutorial 7.xcscheme
│ │ │ └── xcschememanagement.plist
│ └── multifilesink.c
│ ├── Python
│ ├── pygst-sdk-tutorials
│ │ ├── README.md
│ │ ├── basic-tutorial-1.py
│ │ ├── basic-tutorial-12-new.py
│ │ ├── basic-tutorial-12.py
│ │ ├── basic-tutorial-13-ext.py
│ │ ├── basic-tutorial-13.py
│ │ ├── basic-tutorial-2.py
│ │ ├── basic-tutorial-3-exc.py
│ │ ├── basic-tutorial-3.py
│ │ ├── basic-tutorial-4.py
│ │ ├── basic-tutorial-5.py
│ │ ├── basic-tutorial-6.py
│ │ ├── basic-tutorial-7.py
│ │ ├── basic-tutorial-8.py
│ │ ├── basic-tutorial-9.py
│ │ ├── playback-tutorial-1.py
│ │ ├── playback-tutorial-2.py
│ │ ├── playback-tutorial-3.py
│ │ ├── playback-tutorial-4.py
│ │ ├── playback-tutorial-5.py
│ │ ├── playback-tutorial-6.py
│ │ ├── playback-tutorial-7-exc.py
│ │ ├── playback-tutorial-7.py
│ │ ├── pygst-sdk-tutorials.pyproj
│ │ └── pygst-sdk-tutorials.sln
│ └── tee_and_rtmpsink.py
│ └── Shell
│ └── videoeffects.sh
├── Python
├── pygst-sdk-tutorials
│ ├── README.md
│ ├── basic-tutorial-1.py
│ ├── basic-tutorial-2.py
│ ├── basic-tutorial-3.py
│ └── basic-tutorial-4.py
└── pygst-tutorial
│ ├── 0.md
│ ├── 1.md
│ ├── 2.md
│ ├── 3.md
│ ├── 4.md
│ ├── 5.md
│ ├── 6.md
│ ├── 7.md
│ ├── 8.md
│ ├── example21.py
│ ├── example22.py
│ ├── example22b.py
│ ├── example23.py
│ ├── example31.py
│ ├── example32.py
│ ├── example33.py
│ ├── example4.py
│ ├── example5.py
│ ├── example61.py
│ ├── example62.py
│ ├── example63.py
│ ├── example71.py
│ ├── example72.py
│ ├── example8.py
│ ├── original
│ ├── 2.pdf
│ ├── 3.pdf
│ ├── 4.pdf
│ ├── 5.pdf
│ ├── 6.pdf
│ ├── 7.pdf
│ └── 8.pdf
│ └── tvlogo.png
├── README.md
├── Rust
└── basic-tutorial
│ └── 1-hello-world
│ ├── .gitignore
│ ├── Cargo.toml
│ ├── README.md
│ └── src
│ └── main.rs
└── Shell
└── videoeffects.sh
/C/.gitignore:
--------------------------------------------------------------------------------
1 | multifilesink
2 | takepic
3 | *.avi
4 | *.png
--------------------------------------------------------------------------------
/CONTRIBUTORS.md:
--------------------------------------------------------------------------------
1 | * **[Rubén González](https://github.com/rubenrua)**
2 | * Original Author
3 |
4 | * **[Marc Macià](https://github.com/MarcMacia)**
5 |
6 | * **[Juan Luís Marí](https://github.com/)**
7 |
8 | * **[Héctor Canto](https://github.com/hectorcanto)**
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | Debug
3 | Release
4 | ipch
5 | *.user
6 | *.sdf
7 | *.suo
8 | *.opensdf
9 | vs/2010/libs
10 | bin
11 | gen
12 | libs
13 | obj
14 | .classpath
15 | .project
16 | .settings
17 | .libs
18 | .cproject
19 | gst-build
20 | project.properties
21 | gst_sdk
22 | .DS_Store
23 | xcuserdata
24 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/README.md:
--------------------------------------------------------------------------------
1 | GStreamer SDK Tutorial
2 | ===================
3 |
4 | See:
5 |
6 | * http://docs.gstreamer.com/display/GstSDK/Tutorials
7 | * http://cgit.freedesktop.org/gstreamer-sdk/gst-sdk-tutorials/
8 | * git://anongit.freedesktop.org/gstreamer-sdk/gst-sdk-tutorials
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/README.md~:
--------------------------------------------------------------------------------
1 | GStreamer SDK Tutorials in Python
2 | ===================
3 |
4 | Python version of gstremaer SDK [1] tutorials [2].
5 | The following sections introduce a series of tutorials designed to help you learn how to use GStreamer, the multi-platform, modular, open-source, media streaming framework.
6 |
7 | Tutorials
8 | ------------
9 |
10 | * Basic tutorial 1: Hello world!
11 | * Basic tutorial 2: GStreamer concepts
12 | * Basic tutorial 3: Dynamic pipelines
13 | * Basic tutorial 4: Time management
14 | * Basic tutorial 5: GUI toolkit integration
15 | * Basic tutorial 6: Media formats and Pad Capabilities
16 | * Basic tutorial 7: Multithreading and Pad Availability
17 | * Basic tutorial 8: Short-cutting the pipeline
18 | * Basic tutorial 9: Media information gathering
19 | * ..
20 |
21 | APIs
22 | ------------
23 |
24 | * Python GStreamer: http://pygstdocs.berlios.de/pygst-reference/index.html
25 | * GStreamer 0.10 Core Reference Manual: http://www.freedesktop.org/software/gstreamer-sdk/data/docs/2012.5/gstreamer-0.10/index.html
26 | * GStreamer Base Plugins 0.10 Plugins Reference Manual: http://www.freedesktop.org/software/gstreamer-sdk/data/docs/2012.5/gst-plugins-base-plugins-0.10/index.html
27 |
28 |
29 | [1]: http://gstreamer.com/
30 | [2]: http://docs.gstreamer.com/display/GstSDK/Tutorials
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-1/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
9 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-1/jni/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := tutorial-1
6 | LOCAL_SRC_FILES := tutorial-1.c
7 | LOCAL_SHARED_LIBRARIES := gstreamer_android
8 | LOCAL_LDLIBS := -llog
9 | include $(BUILD_SHARED_LIBRARY)
10 |
11 | ifndef GSTREAMER_SDK_ROOT
12 | ifndef GSTREAMER_SDK_ROOT_ANDROID
13 | $(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
14 | endif
15 | GSTREAMER_SDK_ROOT := $(GSTREAMER_SDK_ROOT_ANDROID)
16 | endif
17 | GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
18 | GSTREAMER_PLUGINS := coreelements
19 | include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk
20 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-1/jni/tutorial-1.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 |
6 | /*
7 | * Java Bindings
8 | */
9 | jstring gst_native_get_gstreamer_info (JNIEnv* env, jobject thiz) {
10 | char *version_utf8 = gst_version_string();
11 | jstring *version_jstring = (*env)->NewStringUTF(env, version_utf8);
12 | g_free (version_utf8);
13 | return version_jstring;
14 | }
15 |
16 | static JNINativeMethod native_methods[] = {
17 | { "nativeGetGStreamerInfo", "()Ljava/lang/String;", (void *) gst_native_get_gstreamer_info}
18 | };
19 |
20 | jint JNI_OnLoad(JavaVM *vm, void *reserved) {
21 | JNIEnv *env = NULL;
22 |
23 | if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_4) != JNI_OK) {
24 | __android_log_print (ANDROID_LOG_ERROR, "tutorial-1", "Could not retrieve JNIEnv");
25 | return 0;
26 | }
27 | jclass klass = (*env)->FindClass (env, "com/gst_sdk_tutorials/tutorial_1/Tutorial1");
28 | (*env)->RegisterNatives (env, klass, native_methods, G_N_ELEMENTS(native_methods));
29 |
30 | return JNI_VERSION_1_4;
31 | }
32 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-1/res/drawable-hdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-1/res/drawable-hdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-1/res/drawable-ldpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-1/res/drawable-ldpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-1/res/drawable-mdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-1/res/drawable-mdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-1/res/drawable-xhdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-1/res/drawable-xhdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-1/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-1/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | GStreamer tutorial 1
4 |
5 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-1/src/com/gst_sdk_tutorials/tutorial_1/Tutorial1.java:
--------------------------------------------------------------------------------
1 | package com.gst_sdk_tutorials.tutorial_1;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.widget.TextView;
6 | import android.widget.Toast;
7 |
8 | import com.gstreamer.GStreamer;
9 |
10 | public class Tutorial1 extends Activity {
11 | private native String nativeGetGStreamerInfo();
12 |
13 | // Called when the activity is first created.
14 | @Override
15 | public void onCreate(Bundle savedInstanceState)
16 | {
17 | super.onCreate(savedInstanceState);
18 |
19 | try {
20 | GStreamer.init(this);
21 | } catch (Exception e) {
22 | Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
23 | finish();
24 | return;
25 | }
26 |
27 | setContentView(R.layout.main);
28 |
29 | TextView tv = (TextView)findViewById(R.id.textview_info);
30 | tv.setText("Welcome to " + nativeGetGStreamerInfo() + " !");
31 | }
32 |
33 | static {
34 | System.loadLibrary("gstreamer_android");
35 | System.loadLibrary("tutorial-1");
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-2/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
9 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-2/jni/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := tutorial-2
6 | LOCAL_SRC_FILES := tutorial-2.c
7 | LOCAL_SHARED_LIBRARIES := gstreamer_android
8 | LOCAL_LDLIBS := -llog
9 | include $(BUILD_SHARED_LIBRARY)
10 |
11 | ifndef GSTREAMER_SDK_ROOT
12 | ifndef GSTREAMER_SDK_ROOT_ANDROID
13 | $(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
14 | endif
15 | GSTREAMER_SDK_ROOT := $(GSTREAMER_SDK_ROOT_ANDROID)
16 | endif
17 | GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
18 | include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
19 | GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_SYS)
20 | include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk
21 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-2/res/drawable-hdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-2/res/drawable-hdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-2/res/drawable-ldpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-2/res/drawable-ldpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-2/res/drawable-mdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-2/res/drawable-mdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-2/res/drawable-xhdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-2/res/drawable-xhdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-2/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
20 |
21 |
28 |
29 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-2/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | GStreamer tutorial 2
4 | Play
5 | Stop
6 |
7 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-3/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
10 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-3/jni/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := tutorial-3
6 | LOCAL_SRC_FILES := tutorial-3.c
7 | LOCAL_SHARED_LIBRARIES := gstreamer_android
8 | LOCAL_LDLIBS := -llog -landroid
9 | include $(BUILD_SHARED_LIBRARY)
10 |
11 | ifndef GSTREAMER_SDK_ROOT
12 | ifndef GSTREAMER_SDK_ROOT_ANDROID
13 | $(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
14 | endif
15 | GSTREAMER_SDK_ROOT := $(GSTREAMER_SDK_ROOT_ANDROID)
16 | endif
17 | GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
18 | include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
19 | GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_SYS) $(GSTREAMER_PLUGINS_EFFECTS)
20 | GSTREAMER_EXTRA_DEPS := gstreamer-interfaces-0.10 gstreamer-video-0.10
21 | include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk
22 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-3/res/drawable-hdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-3/res/drawable-hdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-3/res/drawable-ldpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-3/res/drawable-ldpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-3/res/drawable-mdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-3/res/drawable-mdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-3/res/drawable-xhdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-3/res/drawable-xhdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-3/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
21 |
22 |
29 |
30 |
37 |
38 |
39 |
44 |
45 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-3/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | GStreamer tutorial 3
4 | Play
5 | Stop
6 |
7 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-3/src/com/gst_sdk_tutorials/tutorial_3/GStreamerSurfaceView.java:
--------------------------------------------------------------------------------
1 | package com.gst_sdk_tutorials.tutorial_3;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.util.Log;
6 | import android.view.SurfaceView;
7 | import android.view.View;
8 |
9 | // A simple SurfaceView whose width and height can be set from the outside
10 | public class GStreamerSurfaceView extends SurfaceView {
11 | public int media_width = 320;
12 | public int media_height = 240;
13 |
14 | // Mandatory constructors, they do not do much
15 | public GStreamerSurfaceView(Context context, AttributeSet attrs,
16 | int defStyle) {
17 | super(context, attrs, defStyle);
18 | }
19 |
20 | public GStreamerSurfaceView(Context context, AttributeSet attrs) {
21 | super(context, attrs);
22 | }
23 |
24 | public GStreamerSurfaceView (Context context) {
25 | super(context);
26 | }
27 |
28 | // Called by the layout manager to find out our size and give us some rules.
29 | // We will try to maximize our size, and preserve the media's aspect ratio if
30 | // we are given the freedom to do so.
31 | @Override
32 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
33 | int width = 0, height = 0;
34 | int wmode = View.MeasureSpec.getMode(widthMeasureSpec);
35 | int hmode = View.MeasureSpec.getMode(heightMeasureSpec);
36 | int wsize = View.MeasureSpec.getSize(widthMeasureSpec);
37 | int hsize = View.MeasureSpec.getSize(heightMeasureSpec);
38 |
39 | Log.i ("GStreamer", "onMeasure called with " + media_width + "x" + media_height);
40 | // Obey width rules
41 | switch (wmode) {
42 | case View.MeasureSpec.AT_MOST:
43 | if (hmode == View.MeasureSpec.EXACTLY) {
44 | width = Math.min(hsize * media_width / media_height, wsize);
45 | break;
46 | }
47 | case View.MeasureSpec.EXACTLY:
48 | width = wsize;
49 | break;
50 | case View.MeasureSpec.UNSPECIFIED:
51 | width = media_width;
52 | }
53 |
54 | // Obey height rules
55 | switch (hmode) {
56 | case View.MeasureSpec.AT_MOST:
57 | if (wmode == View.MeasureSpec.EXACTLY) {
58 | height = Math.min(wsize * media_height / media_width, hsize);
59 | break;
60 | }
61 | case View.MeasureSpec.EXACTLY:
62 | height = hsize;
63 | break;
64 | case View.MeasureSpec.UNSPECIFIED:
65 | height = media_height;
66 | }
67 |
68 | // Finally, calculate best size when both axis are free
69 | if (hmode == View.MeasureSpec.AT_MOST && wmode == View.MeasureSpec.AT_MOST) {
70 | int correct_height = width * media_height / media_width;
71 | int correct_width = height * media_width / media_height;
72 |
73 | if (correct_height < height)
74 | height = correct_height;
75 | else
76 | width = correct_width;
77 | }
78 |
79 | // Obey minimum size
80 | width = Math.max (getSuggestedMinimumWidth(), width);
81 | height = Math.max (getSuggestedMinimumHeight(), height);
82 | setMeasuredDimension(width, height);
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-4/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
11 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-4/jni/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := tutorial-4
6 | LOCAL_SRC_FILES := tutorial-4.c
7 | LOCAL_SHARED_LIBRARIES := gstreamer_android
8 | LOCAL_LDLIBS := -llog -landroid
9 | include $(BUILD_SHARED_LIBRARY)
10 |
11 | ifndef GSTREAMER_SDK_ROOT
12 | ifndef GSTREAMER_SDK_ROOT_ANDROID
13 | $(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
14 | endif
15 | GSTREAMER_SDK_ROOT := $(GSTREAMER_SDK_ROOT_ANDROID)
16 | endif
17 | GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
18 | include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
19 | GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_PLAYBACK) $(GSTREAMER_PLUGINS_CODECS) $(GSTREAMER_PLUGINS_NET) $(GSTREAMER_PLUGINS_SYS)
20 | GSTREAMER_EXTRA_DEPS := gstreamer-interfaces-0.10 gstreamer-video-0.10
21 | include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk
22 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-4/res/drawable-hdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-4/res/drawable-hdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-4/res/drawable-ldpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-4/res/drawable-ldpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-4/res/drawable-mdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-4/res/drawable-mdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-4/res/drawable-xhdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-4/res/drawable-xhdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-4/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
21 |
22 |
29 |
30 |
37 |
38 |
39 |
45 |
46 |
53 |
54 |
61 |
62 |
63 |
68 |
69 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-4/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | GStreamer tutorial 4
4 | Play
5 | Stop
6 |
7 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-4/src/com/gst_sdk_tutorials/tutorial_4/GStreamerSurfaceView.java:
--------------------------------------------------------------------------------
1 | package com.gst_sdk_tutorials.tutorial_4;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.util.Log;
6 | import android.view.SurfaceView;
7 | import android.view.View;
8 |
9 | // A simple SurfaceView whose width and height can be set from the outside
10 | public class GStreamerSurfaceView extends SurfaceView {
11 | public int media_width = 320;
12 | public int media_height = 240;
13 |
14 | // Mandatory constructors, they do not do much
15 | public GStreamerSurfaceView(Context context, AttributeSet attrs,
16 | int defStyle) {
17 | super(context, attrs, defStyle);
18 | }
19 |
20 | public GStreamerSurfaceView(Context context, AttributeSet attrs) {
21 | super(context, attrs);
22 | }
23 |
24 | public GStreamerSurfaceView (Context context) {
25 | super(context);
26 | }
27 |
28 | // Called by the layout manager to find out our size and give us some rules.
29 | // We will try to maximize our size, and preserve the media's aspect ratio if
30 | // we are given the freedom to do so.
31 | @Override
32 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
33 | int width = 0, height = 0;
34 | int wmode = View.MeasureSpec.getMode(widthMeasureSpec);
35 | int hmode = View.MeasureSpec.getMode(heightMeasureSpec);
36 | int wsize = View.MeasureSpec.getSize(widthMeasureSpec);
37 | int hsize = View.MeasureSpec.getSize(heightMeasureSpec);
38 |
39 | Log.i ("GStreamer", "onMeasure called with " + media_width + "x" + media_height);
40 | // Obey width rules
41 | switch (wmode) {
42 | case View.MeasureSpec.AT_MOST:
43 | if (hmode == View.MeasureSpec.EXACTLY) {
44 | width = Math.min(hsize * media_width / media_height, wsize);
45 | break;
46 | }
47 | case View.MeasureSpec.EXACTLY:
48 | width = wsize;
49 | break;
50 | case View.MeasureSpec.UNSPECIFIED:
51 | width = media_width;
52 | }
53 |
54 | // Obey height rules
55 | switch (hmode) {
56 | case View.MeasureSpec.AT_MOST:
57 | if (wmode == View.MeasureSpec.EXACTLY) {
58 | height = Math.min(wsize * media_height / media_width, hsize);
59 | break;
60 | }
61 | case View.MeasureSpec.EXACTLY:
62 | height = hsize;
63 | break;
64 | case View.MeasureSpec.UNSPECIFIED:
65 | height = media_height;
66 | }
67 |
68 | // Finally, calculate best size when both axis are free
69 | if (hmode == View.MeasureSpec.AT_MOST && wmode == View.MeasureSpec.AT_MOST) {
70 | int correct_height = width * media_height / media_width;
71 | int correct_width = height * media_width / media_height;
72 |
73 | if (correct_height < height)
74 | height = correct_height;
75 | else
76 | width = correct_width;
77 | }
78 |
79 | // Obey minimum size
80 | width = Math.max (getSuggestedMinimumWidth(), width);
81 | height = Math.max (getSuggestedMinimumHeight(), height);
82 | setMeasuredDimension(width, height);
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/jni/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := tutorial-5
6 | LOCAL_SRC_FILES := tutorial-5.c
7 | LOCAL_SHARED_LIBRARIES := gstreamer_android
8 | LOCAL_LDLIBS := -llog -landroid
9 | include $(BUILD_SHARED_LIBRARY)
10 |
11 | ifndef GSTREAMER_SDK_ROOT
12 | ifndef GSTREAMER_SDK_ROOT_ANDROID
13 | $(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
14 | endif
15 | GSTREAMER_SDK_ROOT := $(GSTREAMER_SDK_ROOT_ANDROID)
16 | endif
17 | GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
18 | include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
19 | GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_PLAYBACK) $(GSTREAMER_PLUGINS_CODECS) $(GSTREAMER_PLUGINS_NET) $(GSTREAMER_PLUGINS_SYS)
20 | G_IO_MODULES := gnutls
21 | GSTREAMER_EXTRA_DEPS := gstreamer-interfaces-0.10 gstreamer-video-0.10
22 | include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk
23 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/drawable-hdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/drawable-hdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/drawable-ldpi/file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/drawable-ldpi/file.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/drawable-ldpi/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/drawable-ldpi/folder.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/drawable-ldpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/drawable-ldpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/drawable-mdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/drawable-mdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/drawable-xhdpi/gst_sdk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/drawable-xhdpi/gst_sdk_icon.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/layout/file_dialog_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
18 |
19 |
23 |
24 |
30 |
31 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/layout/file_dialog_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
23 |
24 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
21 |
22 |
29 |
30 |
37 |
38 |
45 |
46 |
47 |
53 |
54 |
61 |
62 |
69 |
70 |
71 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | GStreamer tutorial 5
4 | Play
5 | Stop
6 | Select
7 | Cancel
8 | Select a file
9 | Location
10 | folder cannot be read
11 | Icon
12 |
13 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/android-tutorial-5/src/com/gst_sdk_tutorials/tutorial_5/GStreamerSurfaceView.java:
--------------------------------------------------------------------------------
1 | package com.gst_sdk_tutorials.tutorial_5;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.util.Log;
6 | import android.view.SurfaceView;
7 | import android.view.View;
8 |
9 | // A simple SurfaceView whose width and height can be set from the outside
10 | public class GStreamerSurfaceView extends SurfaceView {
11 | public int media_width = 320;
12 | public int media_height = 240;
13 |
14 | // Mandatory constructors, they do not do much
15 | public GStreamerSurfaceView(Context context, AttributeSet attrs,
16 | int defStyle) {
17 | super(context, attrs, defStyle);
18 | }
19 |
20 | public GStreamerSurfaceView(Context context, AttributeSet attrs) {
21 | super(context, attrs);
22 | }
23 |
24 | public GStreamerSurfaceView (Context context) {
25 | super(context);
26 | }
27 |
28 | // Called by the layout manager to find out our size and give us some rules.
29 | // We will try to maximize our size, and preserve the media's aspect ratio if
30 | // we are given the freedom to do so.
31 | @Override
32 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
33 | int width = 0, height = 0;
34 | int wmode = View.MeasureSpec.getMode(widthMeasureSpec);
35 | int hmode = View.MeasureSpec.getMode(heightMeasureSpec);
36 | int wsize = View.MeasureSpec.getSize(widthMeasureSpec);
37 | int hsize = View.MeasureSpec.getSize(heightMeasureSpec);
38 |
39 | Log.i ("GStreamer", "onMeasure called with " + media_width + "x" + media_height);
40 | // Obey width rules
41 | switch (wmode) {
42 | case View.MeasureSpec.AT_MOST:
43 | if (hmode == View.MeasureSpec.EXACTLY) {
44 | width = Math.min(hsize * media_width / media_height, wsize);
45 | break;
46 | }
47 | case View.MeasureSpec.EXACTLY:
48 | width = wsize;
49 | break;
50 | case View.MeasureSpec.UNSPECIFIED:
51 | width = media_width;
52 | }
53 |
54 | // Obey height rules
55 | switch (hmode) {
56 | case View.MeasureSpec.AT_MOST:
57 | if (wmode == View.MeasureSpec.EXACTLY) {
58 | height = Math.min(wsize * media_height / media_width, hsize);
59 | break;
60 | }
61 | case View.MeasureSpec.EXACTLY:
62 | height = hsize;
63 | break;
64 | case View.MeasureSpec.UNSPECIFIED:
65 | height = media_height;
66 | }
67 |
68 | // Finally, calculate best size when both axis are free
69 | if (hmode == View.MeasureSpec.AT_MOST && wmode == View.MeasureSpec.AT_MOST) {
70 | int correct_height = width * media_height / media_width;
71 | int correct_width = height * media_width / media_height;
72 |
73 | if (correct_height < height)
74 | height = correct_height;
75 | else
76 | width = correct_width;
77 | }
78 |
79 | // Obey minimum size
80 | width = Math.max (getSuggestedMinimumWidth(), width);
81 | height = Math.max (getSuggestedMinimumHeight(), height);
82 | setMeasuredDimension(width, height);
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/basic-tutorial-1.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(int argc, char *argv[]) {
4 | GstElement *pipeline;
5 | GstBus *bus;
6 | GstMessage *msg;
7 |
8 | /* Initialize GStreamer */
9 | gst_init (&argc, &argv);
10 |
11 | /* Build the pipeline */
12 | pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
13 |
14 | /* Start playing */
15 | gst_element_set_state (pipeline, GST_STATE_PLAYING);
16 |
17 | /* Wait until error or EOS */
18 | bus = gst_element_get_bus (pipeline);
19 | msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
20 |
21 | /* Free resources */
22 | if (msg != NULL)
23 | gst_message_unref (msg);
24 | gst_object_unref (bus);
25 | gst_element_set_state (pipeline, GST_STATE_NULL);
26 | gst_object_unref (pipeline);
27 | return 0;
28 | }
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/basic-tutorial-12.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | typedef struct _CustomData {
5 | gboolean is_live;
6 | GstElement *pipeline;
7 | GMainLoop *loop;
8 | } CustomData;
9 |
10 | static void cb_message (GstBus *bus, GstMessage *msg, CustomData *data) {
11 |
12 | switch (GST_MESSAGE_TYPE (msg)) {
13 | case GST_MESSAGE_ERROR: {
14 | GError *err;
15 | gchar *debug;
16 |
17 | gst_message_parse_error (msg, &err, &debug);
18 | g_print ("Error: %s\n", err->message);
19 | g_error_free (err);
20 | g_free (debug);
21 |
22 | gst_element_set_state (data->pipeline, GST_STATE_READY);
23 | g_main_loop_quit (data->loop);
24 | break;
25 | }
26 | case GST_MESSAGE_EOS:
27 | /* end-of-stream */
28 | gst_element_set_state (data->pipeline, GST_STATE_READY);
29 | g_main_loop_quit (data->loop);
30 | break;
31 | case GST_MESSAGE_BUFFERING: {
32 | gint percent = 0;
33 |
34 | /* If the stream is live, we do not care about buffering. */
35 | if (data->is_live) break;
36 |
37 | gst_message_parse_buffering (msg, &percent);
38 | g_print ("Buffering (%3d%%)\r", percent);
39 | /* Wait until buffering is complete before start/resume playing */
40 | if (percent < 100)
41 | gst_element_set_state (data->pipeline, GST_STATE_PAUSED);
42 | else
43 | gst_element_set_state (data->pipeline, GST_STATE_PLAYING);
44 | break;
45 | }
46 | case GST_MESSAGE_CLOCK_LOST:
47 | /* Get a new clock */
48 | gst_element_set_state (data->pipeline, GST_STATE_PAUSED);
49 | gst_element_set_state (data->pipeline, GST_STATE_PLAYING);
50 | break;
51 | default:
52 | /* Unhandled message */
53 | break;
54 | }
55 | }
56 |
57 | int main(int argc, char *argv[]) {
58 | GstElement *pipeline;
59 | GstBus *bus;
60 | GstStateChangeReturn ret;
61 | GMainLoop *main_loop;
62 | CustomData data;
63 |
64 | /* Initialize GStreamer */
65 | gst_init (&argc, &argv);
66 |
67 | /* Initialize our data structure */
68 | memset (&data, 0, sizeof (data));
69 |
70 | /* Build the pipeline */
71 | pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
72 | bus = gst_element_get_bus (pipeline);
73 |
74 | /* Start playing */
75 | ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
76 | if (ret == GST_STATE_CHANGE_FAILURE) {
77 | g_printerr ("Unable to set the pipeline to the playing state.\n");
78 | gst_object_unref (pipeline);
79 | return -1;
80 | } else if (ret == GST_STATE_CHANGE_NO_PREROLL) {
81 | data.is_live = TRUE;
82 | }
83 |
84 | main_loop = g_main_loop_new (NULL, FALSE);
85 | data.loop = main_loop;
86 | data.pipeline = pipeline;
87 |
88 | gst_bus_add_signal_watch (bus);
89 | g_signal_connect (bus, "message", G_CALLBACK (cb_message), &data);
90 |
91 | g_main_loop_run (main_loop);
92 |
93 | /* Free resources */
94 | g_main_loop_unref (main_loop);
95 | gst_object_unref (bus);
96 | gst_element_set_state (pipeline, GST_STATE_NULL);
97 | gst_object_unref (pipeline);
98 | return 0;
99 | }
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/basic-tutorial-2.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(int argc, char *argv[]) {
4 | GstElement *pipeline, *source, *sink;
5 | GstBus *bus;
6 | GstMessage *msg;
7 | GstStateChangeReturn ret;
8 |
9 | /* Initialize GStreamer */
10 | gst_init (&argc, &argv);
11 |
12 | /* Create the elements */
13 | source = gst_element_factory_make ("videotestsrc", "source");
14 | sink = gst_element_factory_make ("autovideosink", "sink");
15 |
16 | /* Create the empty pipeline */
17 | pipeline = gst_pipeline_new ("test-pipeline");
18 |
19 | if (!pipeline || !source || !sink) {
20 | g_printerr ("Not all elements could be created.\n");
21 | return -1;
22 | }
23 |
24 | /* Build the pipeline */
25 | gst_bin_add_many (GST_BIN (pipeline), source, sink, NULL);
26 | if (gst_element_link (source, sink) != TRUE) {
27 | g_printerr ("Elements could not be linked.\n");
28 | gst_object_unref (pipeline);
29 | return -1;
30 | }
31 |
32 | /* Modify the source's properties */
33 | g_object_set (source, "pattern", 0, NULL);
34 |
35 | /* Start playing */
36 | ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
37 | if (ret == GST_STATE_CHANGE_FAILURE) {
38 | g_printerr ("Unable to set the pipeline to the playing state.\n");
39 | gst_object_unref (pipeline);
40 | return -1;
41 | }
42 |
43 | /* Wait until error or EOS */
44 | bus = gst_element_get_bus (pipeline);
45 | msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
46 |
47 | /* Parse message */
48 | if (msg != NULL) {
49 | GError *err;
50 | gchar *debug_info;
51 |
52 | switch (GST_MESSAGE_TYPE (msg)) {
53 | case GST_MESSAGE_ERROR:
54 | gst_message_parse_error (msg, &err, &debug_info);
55 | g_printerr ("Error received from element %s: %s\n", GST_OBJECT_NAME (msg->src), err->message);
56 | g_printerr ("Debugging information: %s\n", debug_info ? debug_info : "none");
57 | g_clear_error (&err);
58 | g_free (debug_info);
59 | break;
60 | case GST_MESSAGE_EOS:
61 | g_print ("End-Of-Stream reached.\n");
62 | break;
63 | default:
64 | /* We should not reach here because we only asked for ERRORs and EOS */
65 | g_printerr ("Unexpected message received.\n");
66 | break;
67 | }
68 | gst_message_unref (msg);
69 | }
70 |
71 | /* Free resources */
72 | gst_object_unref (bus);
73 | gst_element_set_state (pipeline, GST_STATE_NULL);
74 | gst_object_unref (pipeline);
75 | return 0;
76 | }
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/playback-tutorial-6.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | /* playbin2 flags */
4 | typedef enum {
5 | GST_PLAY_FLAG_VIS = (1 << 3) /* Enable rendering of visualizations when there is no video stream. */
6 | } GstPlayFlags;
7 |
8 | /* Return TRUE if this is a Visualization element */
9 | static gboolean filter_vis_features (GstPluginFeature *feature, gpointer data) {
10 | GstElementFactory *factory;
11 |
12 | if (!GST_IS_ELEMENT_FACTORY (feature))
13 | return FALSE;
14 | factory = GST_ELEMENT_FACTORY (feature);
15 | if (!g_strrstr (gst_element_factory_get_klass (factory), "Visualization"))
16 | return FALSE;
17 |
18 | return TRUE;
19 | }
20 |
21 | int main(int argc, char *argv[]) {
22 | GstElement *pipeline, *vis_plugin;
23 | GstBus *bus;
24 | GstMessage *msg;
25 | GList *list, *walk;
26 | GstElementFactory *selected_factory = NULL;
27 | guint flags;
28 |
29 | /* Initialize GStreamer */
30 | gst_init (&argc, &argv);
31 |
32 | /* Get a list of all visualization plugins */
33 | list = gst_registry_feature_filter (gst_registry_get_default (), filter_vis_features, FALSE, NULL);
34 |
35 | /* Print their names */
36 | g_print("Available visualization plugins:\n");
37 | for (walk = list; walk != NULL; walk = g_list_next (walk)) {
38 | const gchar *name;
39 | GstElementFactory *factory;
40 |
41 | factory = GST_ELEMENT_FACTORY (walk->data);
42 | name = gst_element_factory_get_longname (factory);
43 | g_print(" %s\n", name);
44 |
45 | if (selected_factory == NULL || g_str_has_prefix (name, "GOOM")) {
46 | selected_factory = factory;
47 | }
48 | }
49 |
50 | /* Don't use the factory if it's still empty */
51 | /* e.g. no visualization plugins found */
52 | if (!selected_factory) {
53 | g_print ("No visualization plugins found!\n");
54 | return -1;
55 | }
56 |
57 | /* We have now selected a factory for the visualization element */
58 | g_print ("Selected '%s'\n", gst_element_factory_get_longname (selected_factory));
59 | vis_plugin = gst_element_factory_create (selected_factory, NULL);
60 | if (!vis_plugin)
61 | return -1;
62 |
63 | /* Build the pipeline */
64 | pipeline = gst_parse_launch ("playbin2 uri=http://radio.hbr1.com:19800/ambient.ogg", NULL);
65 |
66 | /* Set the visualization flag */
67 | g_object_get (pipeline, "flags", &flags, NULL);
68 | flags |= GST_PLAY_FLAG_VIS;
69 | g_object_set (pipeline, "flags", flags, NULL);
70 |
71 | /* set vis plugin for playbin2 */
72 | g_object_set (pipeline, "vis-plugin", vis_plugin, NULL);
73 |
74 | /* Start playing */
75 | gst_element_set_state (pipeline, GST_STATE_PLAYING);
76 |
77 | /* Wait until error or EOS */
78 | bus = gst_element_get_bus (pipeline);
79 | msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
80 |
81 | /* Free resources */
82 | if (msg != NULL)
83 | gst_message_unref (msg);
84 | gst_plugin_feature_list_free (list);
85 | gst_object_unref (bus);
86 | gst_element_set_state (pipeline, GST_STATE_NULL);
87 | gst_object_unref (pipeline);
88 | return 0;
89 | }
90 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/playback-tutorial-7.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(int argc, char *argv[]) {
4 | GstElement *pipeline, *bin, *equalizer, *convert, *sink;
5 | GstPad *pad, *ghost_pad;
6 | GstBus *bus;
7 | GstMessage *msg;
8 |
9 | /* Initialize GStreamer */
10 | gst_init (&argc, &argv);
11 |
12 | /* Build the pipeline */
13 | pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
14 |
15 | /* Create the elements inside the sink bin */
16 | equalizer = gst_element_factory_make ("equalizer-3bands", "equalizer");
17 | convert = gst_element_factory_make ("audioconvert", "convert");
18 | sink = gst_element_factory_make ("autoaudiosink", "audio_sink");
19 | if (!equalizer || !convert || !sink) {
20 | g_printerr ("Not all elements could be created.\n");
21 | return -1;
22 | }
23 |
24 | /* Create the sink bin, add the elements and link them */
25 | bin = gst_bin_new ("audio_sink_bin");
26 | gst_bin_add_many (GST_BIN (bin), equalizer, convert, sink, NULL);
27 | gst_element_link_many (equalizer, convert, sink, NULL);
28 | pad = gst_element_get_static_pad (equalizer, "sink");
29 | ghost_pad = gst_ghost_pad_new ("sink", pad);
30 | gst_pad_set_active (ghost_pad, TRUE);
31 | gst_element_add_pad (bin, ghost_pad);
32 | gst_object_unref (pad);
33 |
34 | /* Configure the equalizer */
35 | g_object_set (G_OBJECT (equalizer), "band1", (gdouble)-24.0, NULL);
36 | g_object_set (G_OBJECT (equalizer), "band2", (gdouble)-24.0, NULL);
37 |
38 | /* Set playbin2's audio sink to be our sink bin */
39 | g_object_set (GST_OBJECT (pipeline), "audio-sink", bin, NULL);
40 |
41 | /* Start playing */
42 | gst_element_set_state (pipeline, GST_STATE_PLAYING);
43 |
44 | /* Wait until error or EOS */
45 | bus = gst_element_get_bus (pipeline);
46 | msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
47 |
48 | /* Free resources */
49 | if (msg != NULL)
50 | gst_message_unref (msg);
51 | gst_object_unref (bus);
52 | gst_element_set_state (pipeline, GST_STATE_NULL);
53 | gst_object_unref (pipeline);
54 | return 0;
55 | }
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/basic-tutorial-1/basic-tutorial-1.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/basic-tutorial-12/basic-tutorial-12.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/basic-tutorial-13/basic-tutorial-13.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/basic-tutorial-15/basic-tutorial-15.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/basic-tutorial-2/basic-tutorial-2.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/basic-tutorial-3/basic-tutorial-3.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/basic-tutorial-4/basic-tutorial-4.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/basic-tutorial-5/basic-tutorial-5.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/basic-tutorial-6/basic-tutorial-6.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/basic-tutorial-7/basic-tutorial-7.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/basic-tutorial-8/basic-tutorial-8.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/basic-tutorial-9/basic-tutorial-9.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/playback-tutorial-1/playback-tutorial-1.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/playback-tutorial-2/playback-tutorial-2.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/playback-tutorial-3/playback-tutorial-3.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/playback-tutorial-4/playback-tutorial-4.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/playback-tutorial-5/playback-tutorial-5.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/playback-tutorial-6/playback-tutorial-6.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/vs2010/playback-tutorial-7/playback-tutorial-7.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/GStreamer iOS Tutorials.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface AppDelegate : UIResponder
4 |
5 | @property (strong, nonatomic) UIWindow *window;
6 |
7 | @end
8 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 |
3 | @implementation AppDelegate
4 |
5 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
6 | {
7 | // Override point for customization after application launch.
8 | return YES;
9 | }
10 |
11 | - (void)applicationWillResignActive:(UIApplication *)application
12 | {
13 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
14 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
15 | }
16 |
17 | - (void)applicationDidEnterBackground:(UIApplication *)application
18 | {
19 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
20 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
21 | }
22 |
23 | - (void)applicationWillEnterForeground:(UIApplication *)application
24 | {
25 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
26 | }
27 |
28 | - (void)applicationDidBecomeActive:(UIApplication *)application
29 | {
30 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
31 | }
32 |
33 | - (void)applicationWillTerminate:(UIApplication *)application
34 | {
35 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
36 | }
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Default-568h@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Default.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Default@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/GStreamerBackend.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface GStreamerBackend : NSObject
4 |
5 | -(NSString*) getGStreamerVersion;
6 |
7 | @end
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/GStreamerBackend.m:
--------------------------------------------------------------------------------
1 | #import "GStreamerBackend.h"
2 |
3 | #include
4 |
5 | @implementation GStreamerBackend
6 |
7 | -(NSString*) getGStreamerVersion
8 | {
9 | char *version_utf8 = gst_version_string();
10 | NSString *version_string = [NSString stringWithUTF8String:version_utf8];
11 | g_free(version_utf8);
12 | return version_string;
13 | }
14 |
15 | @end
16 |
17 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Images/appicon-1-iPad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Images/appicon-1-iPad.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Images/appicon-1-iPad@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Images/appicon-1-iPad@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Images/appicon-1-iPhone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Images/appicon-1-iPhone.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Images/appicon-1-iPhone@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Images/appicon-1-iPhone@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Tutorial 1-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIcons
12 |
13 | CFBundlePrimaryIcon
14 |
15 | CFBundleIconFiles
16 |
17 | appicon-1-iPhone.png
18 | appicon-1-iPhone@2x.png
19 | appicon-1-iPad.png
20 | appicon-1-iPad@2x.png
21 |
22 |
23 |
24 | CFBundleIdentifier
25 | gstreamer-sdk.${PRODUCT_NAME:rfc1034identifier}
26 | CFBundleInfoDictionaryVersion
27 | 6.0
28 | CFBundleName
29 | ${PRODUCT_NAME}
30 | CFBundlePackageType
31 | APPL
32 | CFBundleShortVersionString
33 | 1.0
34 | CFBundleSignature
35 | ????
36 | CFBundleVersion
37 | 1.0
38 | LSRequiresIPhoneOS
39 |
40 | UIMainStoryboardFile
41 | MainStoryboard_iPhone
42 | UIMainStoryboardFile~ipad
43 | MainStoryboard_iPad
44 | UIRequiredDeviceCapabilities
45 |
46 | armv7
47 |
48 | UISupportedInterfaceOrientations
49 |
50 | UIInterfaceOrientationPortrait
51 | UIInterfaceOrientationLandscapeLeft
52 | UIInterfaceOrientationLandscapeRight
53 |
54 | UISupportedInterfaceOrientations~ipad
55 |
56 | UIInterfaceOrientationPortrait
57 | UIInterfaceOrientationPortraitUpsideDown
58 | UIInterfaceOrientationLandscapeLeft
59 | UIInterfaceOrientationLandscapeRight
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Tutorial 1-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'Tutorial 1' target in the 'Tutorial 1' project
3 | //
4 |
5 | #import
6 |
7 | #ifndef __IPHONE_5_0
8 | #warning "This project uses features only available in iOS SDK 5.0 and later."
9 | #endif
10 |
11 | #ifdef __OBJC__
12 | #import
13 | #import
14 | #endif
15 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Ubuntu-R.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/Ubuntu-R.ttf
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/ViewController.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface ViewController : UIViewController {
4 | IBOutlet UILabel *label;
5 | }
6 |
7 | @property (retain,nonatomic) UILabel *label;
8 |
9 | @end
10 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/ViewController.m:
--------------------------------------------------------------------------------
1 | #import "ViewController.h"
2 | #import "GStreamerBackend.h"
3 |
4 | @interface ViewController () {
5 | GStreamerBackend *gst_backend;
6 | }
7 |
8 | @end
9 |
10 | @implementation ViewController
11 |
12 | @synthesize label;
13 |
14 | - (void)viewDidLoad
15 | {
16 | [super viewDidLoad];
17 | // Do any additional setup after loading the view, typically from a nib.
18 | gst_backend = [[GStreamerBackend alloc] init];
19 |
20 | label.text = [NSString stringWithFormat:@"Welcome to %@!", [gst_backend getGStreamerVersion]];
21 | }
22 |
23 | - (void)didReceiveMemoryWarning
24 | {
25 | [super didReceiveMemoryWarning];
26 | // Dispose of any resources that can be recreated.
27 | }
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/gst_ios_init.h:
--------------------------------------------------------------------------------
1 | #ifndef __GST_IOS_INIT_H__
2 | #define __GST_IOS_INIT_H__
3 |
4 | #include
5 |
6 | G_BEGIN_DECLS
7 |
8 | /* Uncomment each line to enable the plugin categories that your application needs.
9 | * You can also enable individual plugins. See gst_ios_init.c to see their names
10 | */
11 |
12 | #define GST_IOS_PLUGINS_CORE
13 | //#define GST_IOS_PLUGINS_CAPTURE
14 | //#define GST_IOS_PLUGINS_CODECS_RESTRICTED
15 | //#define GST_IOS_PLUGINS_ENCODING
16 | //#define GST_IOS_PLUGINS_DVD
17 | //#define GST_IOS_PLUGINS_CODECS_GPL
18 | //#define GST_IOS_PLUGINS_NET_RESTRICTED
19 | //#define GST_IOS_PLUGINS_SYS
20 | //#define GST_IOS_PLUGINS_VIS
21 | //#define GST_IOS_PLUGINS_PLAYBACK
22 | //#define GST_IOS_PLUGINS_EFFECTS
23 | //#define GST_IOS_PLUGINS_CODECS
24 | //#define GST_IOS_PLUGINS_NET
25 |
26 | void gst_ios_init ();
27 |
28 | G_END_DECLS
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 1/main.m:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "AppDelegate.h"
4 | #include "gst_ios_init.h"
5 |
6 | int main(int argc, char *argv[])
7 | {
8 | @autoreleasepool {
9 | gst_ios_init();
10 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface AppDelegate : UIResponder
4 |
5 | @property (strong, nonatomic) UIWindow *window;
6 |
7 | @end
8 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 |
3 | @implementation AppDelegate
4 |
5 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
6 | {
7 | // Override point for customization after application launch.
8 | return YES;
9 | }
10 |
11 | - (void)applicationWillResignActive:(UIApplication *)application
12 | {
13 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
14 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
15 | }
16 |
17 | - (void)applicationDidEnterBackground:(UIApplication *)application
18 | {
19 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
20 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
21 | }
22 |
23 | - (void)applicationWillEnterForeground:(UIApplication *)application
24 | {
25 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
26 | }
27 |
28 | - (void)applicationDidBecomeActive:(UIApplication *)application
29 | {
30 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
31 | }
32 |
33 | - (void)applicationWillTerminate:(UIApplication *)application
34 | {
35 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
36 | }
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Default-568h@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Default.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Default@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/GStreamerBackend.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import "GStreamerBackendDelegate.h"
3 |
4 | @interface GStreamerBackend : NSObject
5 |
6 | /* Initialization method. Pass the delegate that will take care of the UI.
7 | * This delegate must implement the GStreamerBackendDelegate protocol */
8 | -(id) init:(id) uiDelegate;
9 |
10 | /* Set the pipeline to PLAYING */
11 | -(void) play;
12 |
13 | /* Set the pipeline to PAUSED */
14 | -(void) pause;
15 |
16 | @end
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/GStreamerBackendDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @protocol GStreamerBackendDelegate
4 |
5 | @optional
6 | /* Called when the GStreamer backend has finished initializing
7 | * and is ready to accept orders. */
8 | -(void) gstreamerInitialized;
9 |
10 | /* Called when the GStreamer backend wants to output some message
11 | * to the screen. */
12 | -(void) gstreamerSetUIMessage:(NSString *)message;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Images/appicon-2-iPad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Images/appicon-2-iPad.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Images/appicon-2-iPad@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Images/appicon-2-iPad@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Images/appicon-2-iPhone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Images/appicon-2-iPhone.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Images/appicon-2-iPhone@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Images/appicon-2-iPhone@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Tutorial 2-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIcons
12 |
13 | CFBundlePrimaryIcon
14 |
15 | CFBundleIconFiles
16 |
17 | appicon-2-iPad.png
18 | appicon-2-iPad@2x.png
19 | appicon-2-iPhone.png
20 | appicon-2-iPhone@2x.png
21 |
22 |
23 |
24 | CFBundleIdentifier
25 | gstreamer-sdk.${PRODUCT_NAME:rfc1034identifier}
26 | CFBundleInfoDictionaryVersion
27 | 6.0
28 | CFBundleName
29 | ${PRODUCT_NAME}
30 | CFBundlePackageType
31 | APPL
32 | CFBundleShortVersionString
33 | 1.0
34 | CFBundleSignature
35 | ????
36 | CFBundleVersion
37 | 1.0
38 | LSRequiresIPhoneOS
39 |
40 | UIMainStoryboardFile
41 | MainStoryboard_iPhone
42 | UIMainStoryboardFile~ipad
43 | MainStoryboard_iPad
44 | UIRequiredDeviceCapabilities
45 |
46 | armv7
47 |
48 | UISupportedInterfaceOrientations
49 |
50 | UIInterfaceOrientationPortrait
51 | UIInterfaceOrientationLandscapeLeft
52 | UIInterfaceOrientationLandscapeRight
53 |
54 | UISupportedInterfaceOrientations~ipad
55 |
56 | UIInterfaceOrientationPortrait
57 | UIInterfaceOrientationPortraitUpsideDown
58 | UIInterfaceOrientationLandscapeLeft
59 | UIInterfaceOrientationLandscapeRight
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Tutorial 2-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'Tutorial 2' target in the 'Tutorial 2' project
3 | //
4 |
5 | #import
6 |
7 | #ifndef __IPHONE_5_0
8 | #warning "This project uses features only available in iOS SDK 5.0 and later."
9 | #endif
10 |
11 | #ifdef __OBJC__
12 | #import
13 | #import
14 | #endif
15 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Tutorial2-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | gstsdk.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UIMainStoryboardFile
28 | MainStoryboard_iPhone
29 | UIMainStoryboardFile~ipad
30 | MainStoryboard_iPad
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UISupportedInterfaceOrientations~ipad
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationPortraitUpsideDown
45 | UIInterfaceOrientationLandscapeLeft
46 | UIInterfaceOrientationLandscapeRight
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Ubuntu-R.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/Ubuntu-R.ttf
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/ViewController.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import "GStreamerBackendDelegate.h"
3 |
4 | @interface ViewController : UIViewController {
5 | IBOutlet UILabel *message_label;
6 | IBOutlet UIBarButtonItem *play_button;
7 | IBOutlet UIBarButtonItem *pause_button;
8 | }
9 |
10 | -(IBAction) play:(id)sender;
11 | -(IBAction) pause:(id)sender;
12 |
13 | /* From GStreamerBackendDelegate */
14 | -(void) gstreamerInitialized;
15 | -(void) gstreamerSetUIMessage:(NSString *)message;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/ViewController.m:
--------------------------------------------------------------------------------
1 | #import "ViewController.h"
2 | #import "GStreamerBackend.h"
3 | #import
4 |
5 | @interface ViewController () {
6 | GStreamerBackend *gst_backend;
7 | }
8 |
9 | @end
10 |
11 | @implementation ViewController
12 |
13 | /*
14 | * Methods from UIViewController
15 | */
16 |
17 | - (void)viewDidLoad
18 | {
19 | [super viewDidLoad];
20 |
21 | play_button.enabled = FALSE;
22 | pause_button.enabled = FALSE;
23 |
24 | gst_backend = [[GStreamerBackend alloc] init:self];
25 | }
26 |
27 | - (void)didReceiveMemoryWarning
28 | {
29 | [super didReceiveMemoryWarning];
30 | // Dispose of any resources that can be recreated.
31 | }
32 |
33 | /* Called when the Play button is pressed */
34 | -(IBAction) play:(id)sender
35 | {
36 | [gst_backend play];
37 | }
38 |
39 | /* Called when the Pause button is pressed */
40 | -(IBAction) pause:(id)sender
41 | {
42 | [gst_backend pause];
43 | }
44 |
45 | /*
46 | * Methods from GstreamerBackendDelegate
47 | */
48 |
49 | -(void) gstreamerInitialized
50 | {
51 | dispatch_async(dispatch_get_main_queue(), ^{
52 | play_button.enabled = TRUE;
53 | pause_button.enabled = TRUE;
54 | message_label.text = @"Ready";
55 | });
56 | }
57 |
58 | -(void) gstreamerSetUIMessage:(NSString *)message
59 | {
60 | dispatch_async(dispatch_get_main_queue(), ^{
61 | message_label.text = message;
62 | });
63 | }
64 |
65 | @end
66 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/gst_ios_init.h:
--------------------------------------------------------------------------------
1 | #ifndef __GST_IOS_INIT_H__
2 | #define __GST_IOS_INIT_H__
3 |
4 | #include
5 |
6 | G_BEGIN_DECLS
7 |
8 | /* Uncomment each line to enable the plugin categories that your application needs.
9 | * You can also enable individual plugins. See gst_ios_init.c to see their names
10 | */
11 |
12 | #define GST_IOS_PLUGINS_CORE
13 | //#define GST_IOS_PLUGINS_CAPTURE
14 | //#define GST_IOS_PLUGINS_CODECS_RESTRICTED
15 | //#define GST_IOS_PLUGINS_ENCODING
16 | //#define GST_IOS_PLUGINS_DVD
17 | //#define GST_IOS_PLUGINS_CODECS_GPL
18 | //#define GST_IOS_PLUGINS_NET_RESTRICTED
19 | #define GST_IOS_PLUGINS_SYS
20 | //#define GST_IOS_PLUGINS_VIS
21 | #define GST_IOS_PLUGINS_PLAYBACK
22 | //#define GST_IOS_PLUGINS_EFFECTS
23 | //#define GST_IOS_PLUGINS_CODECS
24 | //#define GST_IOS_PLUGINS_NET
25 |
26 | void gst_ios_init ();
27 |
28 | G_END_DECLS
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 2/main.m:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "AppDelegate.h"
4 | #include "gst_ios_init.h"
5 |
6 | int main(int argc, char *argv[])
7 | {
8 | @autoreleasepool {
9 | gst_ios_init();
10 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface AppDelegate : UIResponder
4 |
5 | @property (strong, nonatomic) UIWindow *window;
6 |
7 | @end
8 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 |
3 | @implementation AppDelegate
4 |
5 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
6 | {
7 | // Override point for customization after application launch.
8 | return YES;
9 | }
10 |
11 | - (void)applicationWillResignActive:(UIApplication *)application
12 | {
13 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
14 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
15 | }
16 |
17 | - (void)applicationDidEnterBackground:(UIApplication *)application
18 | {
19 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
20 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
21 | }
22 |
23 | - (void)applicationWillEnterForeground:(UIApplication *)application
24 | {
25 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
26 | }
27 |
28 | - (void)applicationDidBecomeActive:(UIApplication *)application
29 | {
30 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
31 | }
32 |
33 | - (void)applicationWillTerminate:(UIApplication *)application
34 | {
35 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
36 | }
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Default-568h@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Default.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Default@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/EaglUIVIew.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #include
4 | #include
5 |
6 | @interface EaglUIView : UIView
7 | {
8 | }
9 |
10 | @end
11 |
12 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/EaglUIVIew.m:
--------------------------------------------------------------------------------
1 | #import "EaglUIVIew.h"
2 |
3 | #import
4 |
5 | @implementation EaglUIView
6 |
7 |
8 | + (Class) layerClass
9 | {
10 | return [CAEAGLLayer class];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/GStreamerBackend.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import "GStreamerBackendDelegate.h"
3 |
4 | @interface GStreamerBackend : NSObject
5 |
6 | /* Initialization method. Pass the delegate that will take care of the UI.
7 | * This delegate must implement the GStreamerBackendDelegate protocol.
8 | * Pass also the UIView object that will hold the video window. */
9 | -(id) init:(id) uiDelegate videoView:(UIView*) video_view;
10 |
11 | /* Set the pipeline to PLAYING */
12 | -(void) play;
13 |
14 | /* Set the pipeline to PAUSED */
15 | -(void) pause;
16 |
17 | @end
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/GStreamerBackendDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @protocol GStreamerBackendDelegate
4 |
5 | @optional
6 | /* Called when the GStreamer backend has finished initializing
7 | * and is ready to accept orders. */
8 | -(void) gstreamerInitialized;
9 |
10 | /* Called when the GStreamer backend wants to output some message
11 | * to the screen. */
12 | -(void) gstreamerSetUIMessage:(NSString *)message;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Images/appicon-3-iPad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Images/appicon-3-iPad.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Images/appicon-3-iPad@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Images/appicon-3-iPad@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Images/appicon-3-iPhone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Images/appicon-3-iPhone.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Images/appicon-3-iPhone@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Images/appicon-3-iPhone@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Tutorial 3-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIcons
12 |
13 | CFBundlePrimaryIcon
14 |
15 | CFBundleIconFiles
16 |
17 | appicon-3-iPad.png
18 | appicon-3-iPad@2x.png
19 | appicon-3-iPhone.png
20 | appicon-3-iPhone@2x.png
21 |
22 |
23 |
24 | CFBundleIdentifier
25 | gstreamer-sdk.${PRODUCT_NAME:rfc1034identifier}
26 | CFBundleInfoDictionaryVersion
27 | 6.0
28 | CFBundleName
29 | ${PRODUCT_NAME}
30 | CFBundlePackageType
31 | APPL
32 | CFBundleShortVersionString
33 | 1.0
34 | CFBundleSignature
35 | ????
36 | CFBundleVersion
37 | 1.0
38 | LSRequiresIPhoneOS
39 |
40 | UIMainStoryboardFile
41 | MainStoryboard_iPhone
42 | UIMainStoryboardFile~ipad
43 | MainStoryboard_iPad
44 | UIRequiredDeviceCapabilities
45 |
46 | armv7
47 |
48 | UISupportedInterfaceOrientations
49 |
50 | UIInterfaceOrientationPortrait
51 | UIInterfaceOrientationLandscapeLeft
52 | UIInterfaceOrientationLandscapeRight
53 |
54 | UISupportedInterfaceOrientations~ipad
55 |
56 | UIInterfaceOrientationPortrait
57 | UIInterfaceOrientationPortraitUpsideDown
58 | UIInterfaceOrientationLandscapeLeft
59 | UIInterfaceOrientationLandscapeRight
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Tutorial 3-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'Tutorial 3' target in the 'Tutorial 3' project
3 | //
4 |
5 | #import
6 |
7 | #ifndef __IPHONE_5_0
8 | #warning "This project uses features only available in iOS SDK 5.0 and later."
9 | #endif
10 |
11 | #ifdef __OBJC__
12 | #import
13 | #import
14 | #endif
15 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Ubuntu-R.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/Ubuntu-R.ttf
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/ViewController.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import "GStreamerBackendDelegate.h"
3 |
4 | @interface ViewController : UIViewController {
5 | IBOutlet UILabel *message_label;
6 | IBOutlet UIBarButtonItem *play_button;
7 | IBOutlet UIBarButtonItem *pause_button;
8 | IBOutlet UIView *video_view;
9 | IBOutlet UIView *video_container_view;
10 | IBOutlet NSLayoutConstraint *video_width_constraint;
11 | IBOutlet NSLayoutConstraint *video_height_constraint;
12 | }
13 |
14 | -(IBAction) play:(id)sender;
15 | -(IBAction) pause:(id)sender;
16 |
17 | /* From GStreamerBackendDelegate */
18 | -(void) gstreamerInitialized;
19 | -(void) gstreamerSetUIMessage:(NSString *)message;
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/ViewController.m:
--------------------------------------------------------------------------------
1 | #import "ViewController.h"
2 | #import "GStreamerBackend.h"
3 | #import
4 |
5 | @interface ViewController () {
6 | GStreamerBackend *gst_backend;
7 | int media_width;
8 | int media_height;
9 | }
10 |
11 | @end
12 |
13 | @implementation ViewController
14 |
15 | /*
16 | * Methods from UIViewController
17 | */
18 |
19 | - (void)viewDidLoad
20 | {
21 | [super viewDidLoad];
22 |
23 | play_button.enabled = FALSE;
24 | pause_button.enabled = FALSE;
25 |
26 | /* Make these constant for now, later tutorials will change them */
27 | media_width = 320;
28 | media_height = 240;
29 |
30 | gst_backend = [[GStreamerBackend alloc] init:self videoView:video_view];
31 | }
32 |
33 | - (void)didReceiveMemoryWarning
34 | {
35 | [super didReceiveMemoryWarning];
36 | // Dispose of any resources that can be recreated.
37 | }
38 |
39 | /* Called when the Play button is pressed */
40 | -(IBAction) play:(id)sender
41 | {
42 | [gst_backend play];
43 | }
44 |
45 | /* Called when the Pause button is pressed */
46 | -(IBAction) pause:(id)sender
47 | {
48 | [gst_backend pause];
49 | }
50 |
51 | - (void)viewDidLayoutSubviews
52 | {
53 | CGFloat view_width = video_container_view.bounds.size.width;
54 | CGFloat view_height = video_container_view.bounds.size.height;
55 |
56 | CGFloat correct_height = view_width * media_height / media_width;
57 | CGFloat correct_width = view_height * media_width / media_height;
58 |
59 | if (correct_height < view_height) {
60 | video_height_constraint.constant = correct_height;
61 | video_width_constraint.constant = view_width;
62 | } else {
63 | video_width_constraint.constant = correct_width;
64 | video_height_constraint.constant = view_height;
65 | }
66 | }
67 |
68 | /*
69 | * Methods from GstreamerBackendDelegate
70 | */
71 |
72 | -(void) gstreamerInitialized
73 | {
74 | dispatch_async(dispatch_get_main_queue(), ^{
75 | play_button.enabled = TRUE;
76 | pause_button.enabled = TRUE;
77 | message_label.text = @"Ready";
78 | });
79 | }
80 |
81 | -(void) gstreamerSetUIMessage:(NSString *)message
82 | {
83 | dispatch_async(dispatch_get_main_queue(), ^{
84 | message_label.text = message;
85 | });
86 | }
87 |
88 | @end
89 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/gst_ios_init.h:
--------------------------------------------------------------------------------
1 | #ifndef __GST_IOS_INIT_H__
2 | #define __GST_IOS_INIT_H__
3 |
4 | #include
5 |
6 | G_BEGIN_DECLS
7 |
8 | /* Uncomment each line to enable the plugin categories that your application needs.
9 | * You can also enable individual plugins. See gst_ios_init.c to see their names
10 | */
11 |
12 | #define GST_IOS_PLUGINS_CORE
13 | //#define GST_IOS_PLUGINS_CAPTURE
14 | //#define GST_IOS_PLUGINS_CODECS_RESTRICTED
15 | //#define GST_IOS_PLUGINS_ENCODING
16 | //#define GST_IOS_PLUGINS_DVD
17 | //#define GST_IOS_PLUGINS_CODECS_GPL
18 | //#define GST_IOS_PLUGINS_NET_RESTRICTED
19 | #define GST_IOS_PLUGINS_SYS
20 | //#define GST_IOS_PLUGINS_VIS
21 | #define GST_IOS_PLUGINS_PLAYBACK
22 | #define GST_IOS_PLUGINS_EFFECTS
23 | //#define GST_IOS_PLUGINS_CODECS
24 | //#define GST_IOS_PLUGINS_NET
25 |
26 | void gst_ios_init ();
27 |
28 | G_END_DECLS
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 3/main.m:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "AppDelegate.h"
4 | #include "gst_ios_init.h"
5 |
6 | int main(int argc, char *argv[])
7 | {
8 | @autoreleasepool {
9 | gst_ios_init();
10 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface AppDelegate : UIResponder
4 |
5 | @property (strong, nonatomic) UIWindow *window;
6 |
7 | @end
8 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 |
3 | @implementation AppDelegate
4 |
5 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
6 | {
7 | // Override point for customization after application launch.
8 | return YES;
9 | }
10 |
11 | - (void)applicationWillResignActive:(UIApplication *)application
12 | {
13 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
14 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
15 | }
16 |
17 | - (void)applicationDidEnterBackground:(UIApplication *)application
18 | {
19 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
20 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
21 | }
22 |
23 | - (void)applicationWillEnterForeground:(UIApplication *)application
24 | {
25 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
26 | }
27 |
28 | - (void)applicationDidBecomeActive:(UIApplication *)application
29 | {
30 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
31 | }
32 |
33 | - (void)applicationWillTerminate:(UIApplication *)application
34 | {
35 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
36 | }
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Default-568h@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Default.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Default@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/EaglUIVIew.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #include
4 | #include
5 |
6 | @interface EaglUIView : UIView
7 | {
8 | }
9 |
10 | @end
11 |
12 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/EaglUIVIew.m:
--------------------------------------------------------------------------------
1 | #import "EaglUIVIew.h"
2 |
3 | #import
4 |
5 | @implementation EaglUIView
6 |
7 |
8 | + (Class) layerClass
9 | {
10 | return [CAEAGLLayer class];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/GStreamerBackend.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import "GStreamerBackendDelegate.h"
3 |
4 | @interface GStreamerBackend : NSObject
5 |
6 | /* Initialization method. Pass the delegate that will take care of the UI.
7 | * This delegate must implement the GStreamerBackendDelegate protocol.
8 | * Pass also the UIView object that will hold the video window. */
9 | -(id) init:(id) uiDelegate videoView:(UIView*) video_view;
10 |
11 | /* Quit the main loop and free all resources, including the pipeline and
12 | * the references to the ui delegate and the UIView used for rendering, so
13 | * these objects can be deallocated. */
14 | -(void) deinit;
15 |
16 | /* Set the pipeline to PLAYING */
17 | -(void) play;
18 |
19 | /* Set the pipeline to PAUSED */
20 | -(void) pause;
21 |
22 | /* Set the URI to be played */
23 | -(void) setUri:(NSString*)uri;
24 |
25 | /* Set the position to seek to, in milliseconds */
26 | -(void) setPosition:(NSInteger)milliseconds;
27 |
28 | @end
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/GStreamerBackendDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @protocol GStreamerBackendDelegate
4 |
5 | @optional
6 | /* Called when the GStreamer backend has finished initializing
7 | * and is ready to accept orders. */
8 | -(void) gstreamerInitialized;
9 |
10 | /* Called when the GStreamer backend wants to output some message
11 | * to the screen. */
12 | -(void) gstreamerSetUIMessage:(NSString *)message;
13 |
14 | /* Called when the media size is first discovered or it changes */
15 | -(void) mediaSizeChanged:(NSInteger)width height:(NSInteger)height;
16 |
17 | /* Called when the media position changes. Times in milliseconds */
18 | -(void) setCurrentPosition:(NSInteger)position duration:(NSInteger)duration;
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Images/appicon-4-iPad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Images/appicon-4-iPad.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Images/appicon-4-iPad@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Images/appicon-4-iPad@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Images/appicon-4-iPhone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Images/appicon-4-iPhone.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Images/appicon-4-iPhone@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Images/appicon-4-iPhone@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Tutorial 4-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIcons
12 |
13 | CFBundlePrimaryIcon
14 |
15 | CFBundleIconFiles
16 |
17 | appicon-4-iPhone.png
18 | appicon-4-iPhone@2x.png
19 | appicon-4-iPad.png
20 | appicon-4-iPad@2x.png
21 |
22 |
23 |
24 | CFBundleIdentifier
25 | gstreamer-sdk.${PRODUCT_NAME:rfc1034identifier}
26 | CFBundleInfoDictionaryVersion
27 | 6.0
28 | CFBundleName
29 | ${PRODUCT_NAME}
30 | CFBundlePackageType
31 | APPL
32 | CFBundleShortVersionString
33 | 1.0
34 | CFBundleSignature
35 | ????
36 | CFBundleVersion
37 | 1.0
38 | LSRequiresIPhoneOS
39 |
40 | UIFileSharingEnabled
41 |
42 | UIMainStoryboardFile
43 | MainStoryboard_iPhone
44 | UIMainStoryboardFile~ipad
45 | MainStoryboard_iPad
46 | UIRequiredDeviceCapabilities
47 |
48 | armv7
49 |
50 | UISupportedInterfaceOrientations
51 |
52 | UIInterfaceOrientationPortrait
53 | UIInterfaceOrientationLandscapeLeft
54 | UIInterfaceOrientationLandscapeRight
55 |
56 | UISupportedInterfaceOrientations~ipad
57 |
58 | UIInterfaceOrientationPortrait
59 | UIInterfaceOrientationPortraitUpsideDown
60 | UIInterfaceOrientationLandscapeLeft
61 | UIInterfaceOrientationLandscapeRight
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Tutorial 4-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'Tutorial 4' target in the 'Tutorial 4' project
3 | //
4 |
5 | #import
6 |
7 | #ifndef __IPHONE_5_0
8 | #warning "This project uses features only available in iOS SDK 5.0 and later."
9 | #endif
10 |
11 | #ifdef __OBJC__
12 | #import
13 | #import
14 | #endif
15 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Ubuntu-R.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/Ubuntu-R.ttf
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/VideoViewController.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import "GStreamerBackendDelegate.h"
3 |
4 | @interface VideoViewController : UIViewController {
5 | IBOutlet UILabel *message_label;
6 | IBOutlet UIBarButtonItem *play_button;
7 | IBOutlet UIBarButtonItem *pause_button;
8 | IBOutlet UIView *video_view;
9 | IBOutlet UIView *video_container_view;
10 | IBOutlet NSLayoutConstraint *video_width_constraint;
11 | IBOutlet NSLayoutConstraint *video_height_constraint;
12 | IBOutlet UIToolbar *toolbar;
13 | IBOutlet UITextField *time_label;
14 | IBOutlet UISlider *time_slider;
15 | }
16 |
17 | @property (retain,nonatomic) NSString *uri;
18 |
19 | -(IBAction) play:(id)sender;
20 | -(IBAction) pause:(id)sender;
21 | -(IBAction) sliderValueChanged:(id)sender;
22 | -(IBAction) sliderTouchDown:(id)sender;
23 | -(IBAction) sliderTouchUp:(id)sender;
24 |
25 | /* From GStreamerBackendDelegate */
26 | -(void) gstreamerInitialized;
27 | -(void) gstreamerSetUIMessage:(NSString *)message;
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/gst_ios_init.h:
--------------------------------------------------------------------------------
1 | #ifndef __GST_IOS_INIT_H__
2 | #define __GST_IOS_INIT_H__
3 |
4 | #include
5 |
6 | G_BEGIN_DECLS
7 |
8 | /* Uncomment each line to enable the plugin categories that your application needs.
9 | * You can also enable individual plugins. See gst_ios_init.c to see their names
10 | */
11 |
12 | #define GST_IOS_PLUGINS_CORE
13 | //#define GST_IOS_PLUGINS_CAPTURE
14 | #define GST_IOS_PLUGINS_CODECS_RESTRICTED
15 | //#define GST_IOS_PLUGINS_ENCODING
16 | //#define GST_IOS_PLUGINS_DVD
17 | #define GST_IOS_PLUGINS_CODECS_GPL
18 | #define GST_IOS_PLUGINS_NET_RESTRICTED
19 | #define GST_IOS_PLUGINS_SYS
20 | //#define GST_IOS_PLUGINS_VIS
21 | #define GST_IOS_PLUGINS_PLAYBACK
22 | #define GST_IOS_PLUGINS_EFFECTS
23 | #define GST_IOS_PLUGINS_CODECS
24 | #define GST_IOS_PLUGINS_NET
25 |
26 | void gst_ios_init ();
27 |
28 | G_END_DECLS
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 4/main.m:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "AppDelegate.h"
4 | #include "gst_ios_init.h"
5 |
6 | int main(int argc, char *argv[])
7 | {
8 | @autoreleasepool {
9 | gst_ios_init();
10 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface AppDelegate : UIResponder
4 |
5 | @property (strong, nonatomic) UIWindow *window;
6 |
7 | @end
8 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 |
3 | @implementation AppDelegate
4 |
5 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
6 | {
7 | // Override point for customization after application launch.
8 | return YES;
9 | }
10 |
11 | - (void)applicationWillResignActive:(UIApplication *)application
12 | {
13 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
14 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
15 | }
16 |
17 | - (void)applicationDidEnterBackground:(UIApplication *)application
18 | {
19 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
20 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
21 | }
22 |
23 | - (void)applicationWillEnterForeground:(UIApplication *)application
24 | {
25 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
26 | }
27 |
28 | - (void)applicationDidBecomeActive:(UIApplication *)application
29 | {
30 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
31 | }
32 |
33 | - (void)applicationWillTerminate:(UIApplication *)application
34 | {
35 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
36 | }
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Default-568h@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Default.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Default@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/EaglUIVIew.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #include
4 | #include
5 |
6 | @interface EaglUIView : UIView
7 | {
8 | }
9 |
10 | @end
11 |
12 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/EaglUIVIew.m:
--------------------------------------------------------------------------------
1 | #import "EaglUIVIew.h"
2 |
3 | #import
4 |
5 | @implementation EaglUIView
6 |
7 |
8 | + (Class) layerClass
9 | {
10 | return [CAEAGLLayer class];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/GStreamerBackend.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import "GStreamerBackendDelegate.h"
3 |
4 | @interface GStreamerBackend : NSObject
5 |
6 | /* Initialization method. Pass the delegate that will take care of the UI.
7 | * This delegate must implement the GStreamerBackendDelegate protocol.
8 | * Pass also the UIView object that will hold the video window. */
9 | -(id) init:(id) uiDelegate videoView:(UIView*) video_view;
10 |
11 | /* Quit the main loop and free all resources, including the pipeline and
12 | * the references to the ui delegate and the UIView used for rendering, so
13 | * these objects can be deallocated. */
14 | -(void) deinit;
15 |
16 | /* Set the pipeline to PLAYING */
17 | -(void) play;
18 |
19 | /* Set the pipeline to PAUSED */
20 | -(void) pause;
21 |
22 | /* Set the URI to be played */
23 | -(void) setUri:(NSString*)uri;
24 |
25 | /* Set the position to seek to, in milliseconds */
26 | -(void) setPosition:(NSInteger)milliseconds;
27 |
28 | @end
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/GStreamerBackendDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @protocol GStreamerBackendDelegate
4 |
5 | @optional
6 | /* Called when the GStreamer backend has finished initializing
7 | * and is ready to accept orders. */
8 | -(void) gstreamerInitialized;
9 |
10 | /* Called when the GStreamer backend wants to output some message
11 | * to the screen. */
12 | -(void) gstreamerSetUIMessage:(NSString *)message;
13 |
14 | /* Called when the media size is first discovered or it changes */
15 | -(void) mediaSizeChanged:(NSInteger)width height:(NSInteger)height;
16 |
17 | /* Called when the media position changes. Times in milliseconds */
18 | -(void) setCurrentPosition:(NSInteger)position duration:(NSInteger)duration;
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Images/appicon-5-iPad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Images/appicon-5-iPad.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Images/appicon-5-iPad@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Images/appicon-5-iPad@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Images/appicon-5-iPhone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Images/appicon-5-iPhone.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Images/appicon-5-iPhone@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Images/appicon-5-iPhone@2x.png
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/LibraryViewController.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface LibraryViewController : UITableViewController
4 | {
5 | NSArray *libraryEntries;
6 | NSArray *mediaEntries;
7 | NSArray *onlineEntries;
8 | }
9 |
10 | - (IBAction)refresh:(id)sender;
11 |
12 | @end
13 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Tutorial 5-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIcons
12 |
13 | CFBundlePrimaryIcon
14 |
15 | CFBundleIconFiles
16 |
17 | appicon-4-iPhone.png
18 | appicon-4-iPhone@2x.png
19 | appicon-4-iPad.png
20 | appicon-4-iPad@2x.png
21 | appicon-5-iPhone.png
22 | appicon-5-iPhone@2x.png
23 | appicon-5-iPad.png
24 | appicon-5-iPad@2x.png
25 |
26 |
27 |
28 | CFBundleIdentifier
29 | gstreamer-sdk.${PRODUCT_NAME:rfc1034identifier}
30 | CFBundleInfoDictionaryVersion
31 | 6.0
32 | CFBundleName
33 | ${PRODUCT_NAME}
34 | CFBundlePackageType
35 | APPL
36 | CFBundleShortVersionString
37 | 1.0
38 | CFBundleSignature
39 | ????
40 | CFBundleVersion
41 | 1.0
42 | LSRequiresIPhoneOS
43 |
44 | UIFileSharingEnabled
45 |
46 | UIMainStoryboardFile
47 | MainStoryboard_iPhone
48 | UIMainStoryboardFile~ipad
49 | MainStoryboard_iPad
50 | UIRequiredDeviceCapabilities
51 |
52 | armv7
53 |
54 | UISupportedInterfaceOrientations
55 |
56 | UIInterfaceOrientationPortrait
57 | UIInterfaceOrientationLandscapeLeft
58 | UIInterfaceOrientationLandscapeRight
59 |
60 | UISupportedInterfaceOrientations~ipad
61 |
62 | UIInterfaceOrientationPortrait
63 | UIInterfaceOrientationPortraitUpsideDown
64 | UIInterfaceOrientationLandscapeLeft
65 | UIInterfaceOrientationLandscapeRight
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Tutorial 5-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'Tutorial 5' target in the 'Tutorial 5' project
3 | //
4 |
5 | #import
6 |
7 | #ifndef __IPHONE_5_0
8 | #warning "This project uses features only available in iOS SDK 5.0 and later."
9 | #endif
10 |
11 | #ifdef __OBJC__
12 | #import
13 | #import
14 | #endif
15 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Ubuntu-R.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/Ubuntu-R.ttf
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/VideoViewController.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import "GStreamerBackendDelegate.h"
3 |
4 | @interface VideoViewController : UIViewController {
5 | IBOutlet UILabel *message_label;
6 | IBOutlet UIBarButtonItem *play_button;
7 | IBOutlet UIBarButtonItem *pause_button;
8 | IBOutlet UIView *video_view;
9 | IBOutlet UIView *video_container_view;
10 | IBOutlet NSLayoutConstraint *video_width_constraint;
11 | IBOutlet NSLayoutConstraint *video_height_constraint;
12 | IBOutlet UIToolbar *toolbar;
13 | IBOutlet UITextField *time_label;
14 | IBOutlet UISlider *time_slider;
15 | }
16 |
17 | @property (retain,nonatomic) NSString *uri;
18 |
19 | -(IBAction) play:(id)sender;
20 | -(IBAction) pause:(id)sender;
21 | -(IBAction) sliderValueChanged:(id)sender;
22 | -(IBAction) sliderTouchDown:(id)sender;
23 | -(IBAction) sliderTouchUp:(id)sender;
24 |
25 | /* From GStreamerBackendDelegate */
26 | -(void) gstreamerInitialized;
27 | -(void) gstreamerSetUIMessage:(NSString *)message;
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/gst_ios_init.h:
--------------------------------------------------------------------------------
1 | #ifndef __GST_IOS_INIT_H__
2 | #define __GST_IOS_INIT_H__
3 |
4 | #include
5 |
6 | G_BEGIN_DECLS
7 |
8 | /* Uncomment each line to enable the plugin categories that your application needs.
9 | * You can also enable individual plugins. See gst_ios_init.c to see their names
10 | */
11 |
12 | #define GST_IOS_PLUGINS_CORE
13 | //#define GST_IOS_PLUGINS_CAPTURE
14 | #define GST_IOS_PLUGINS_CODECS_RESTRICTED
15 | //#define GST_IOS_PLUGINS_ENCODING
16 | //#define GST_IOS_PLUGINS_DVD
17 | #define GST_IOS_PLUGINS_CODECS_GPL
18 | #define GST_IOS_PLUGINS_NET_RESTRICTED
19 | #define GST_IOS_PLUGINS_SYS
20 | //#define GST_IOS_PLUGINS_VIS
21 | #define GST_IOS_PLUGINS_PLAYBACK
22 | #define GST_IOS_PLUGINS_EFFECTS
23 | #define GST_IOS_PLUGINS_CODECS
24 | #define GST_IOS_PLUGINS_NET
25 |
26 | void gst_ios_init ();
27 |
28 | G_END_DECLS
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode iOS/Tutorial 5/main.m:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "AppDelegate.h"
4 | #include "gst_ios_init.h"
5 |
6 | int main(int argc, char *argv[])
7 | {
8 | @autoreleasepool {
9 | gst_ios_init();
10 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode/GStreamer Tutorials.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode/GStreamer Tutorials.xcodeproj/xcshareddata/xcschemes/01-Tutorial 1.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
8 |
14 |
20 |
21 |
22 |
23 |
24 |
29 |
30 |
31 |
32 |
38 |
39 |
40 |
41 |
49 |
50 |
56 |
57 |
58 |
59 |
60 |
61 |
67 |
68 |
74 |
75 |
76 |
77 |
79 |
80 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode/GStreamer Tutorials.xcodeproj/xcshareddata/xcschemes/02-Tutorial 2.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
8 |
14 |
20 |
21 |
22 |
23 |
24 |
29 |
30 |
31 |
32 |
38 |
39 |
40 |
41 |
49 |
50 |
56 |
57 |
58 |
59 |
60 |
61 |
67 |
68 |
74 |
75 |
76 |
77 |
79 |
80 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/Other/0.10/C/gst-sdk-tutorials/xcode/GStreamer Tutorials.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SuppressBuildableAutocreation
6 |
7 | 63118C53156D29DE0085CF03
8 |
9 | primary
10 |
11 |
12 | 63118C74156D2B970085CF03
13 |
14 | primary
15 |
16 |
17 | 63118C87156D2D190085CF03
18 |
19 | primary
20 |
21 |
22 | 63118C97156D2E2F0085CF03
23 |
24 | primary
25 |
26 |
27 | 63118CB8156D31240085CF03
28 |
29 | primary
30 |
31 |
32 | 63118CC7156D32E20085CF03
33 |
34 | primary
35 |
36 |
37 | 63118CD8156D34BA0085CF03
38 |
39 | primary
40 |
41 |
42 | 63118CE9156D3A870085CF03
43 |
44 | primary
45 |
46 |
47 | 63DE8811156DABDF006F2D3B
48 |
49 | primary
50 |
51 |
52 | 63DE881F156DABE6006F2D3B
53 |
54 | primary
55 |
56 |
57 | 63DE882D156DABEE006F2D3B
58 |
59 | primary
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/Other/0.10/Python/pygst-sdk-tutorials/README.md:
--------------------------------------------------------------------------------
1 | GStreamer SDK Tutorials in Python
2 | ===================
3 |
4 | Python version of gstremaer SDK [1] tutorials [2].
5 | The following sections introduce a series of tutorials designed to help you learn how to use GStreamer, the multi-platform, modular, open-source, media streaming framework.
6 |
7 | Tutorials
8 | ------------
9 |
10 | * Basic tutorial 1: Hello world!
11 | * Basic tutorial 2: GStreamer concepts
12 | * Basic tutorial 3: Dynamic pipelines
13 | * Basic tutorial 4: Time management
14 | * Basic tutorial 5: GUI toolkit integration
15 | * Basic tutorial 6: Media formats and Pad Capabilities
16 | * Basic tutorial 7: Multithreading and Pad Availability
17 | * Basic tutorial 8: Short-cutting the pipeline
18 | * Basic tutorial 9: Media information gathering
19 | * ..
20 |
21 | APIs
22 | ------------
23 |
24 | * Python GStreamer: http://pygstdocs.berlios.de/pygst-reference/index.html
25 | * GStreamer 0.10 Core Reference Manual: http://www.freedesktop.org/software/gstreamer-sdk/data/docs/2012.5/gstreamer-0.10/index.html
26 | * GStreamer Base Plugins 0.10 Plugins Reference Manual: http://www.freedesktop.org/software/gstreamer-sdk/data/docs/2012.5/gst-plugins-base-plugins-0.10/index.html
27 |
28 |
29 | [1]: http://gstreamer.com/
30 | [2]: http://docs.gstreamer.com/display/GstSDK/Tutorials
--------------------------------------------------------------------------------
/Other/0.10/Python/pygst-sdk-tutorials/basic-tutorial-1.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding:utf-8 -*-
3 | # GStreamer SDK Tutorials in Python
4 | #
5 | # basic-tutorial-1
6 | #
7 | """
8 | basic-tutorial-1: Hello world!
9 | http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+2%3A+GStreamer+concepts
10 | """
11 |
12 | import gst
13 |
14 | # Build the pipeline
15 | pipeline = gst.parse_launch("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm")
16 |
17 | # Start playing
18 | pipeline.set_state(gst.STATE_PLAYING)
19 |
20 | # Wait until error or EOS
21 | bus = pipeline.get_bus()
22 | msg = bus.timed_pop_filtered(gst.CLOCK_TIME_NONE, gst.MESSAGE_ERROR | gst.MESSAGE_EOS)
23 |
24 | # Free resources
25 | pipeline.set_state(gst.STATE_NULL)
26 |
--------------------------------------------------------------------------------
/Other/0.10/Python/pygst-sdk-tutorials/basic-tutorial-12-new.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding:utf-8 -*-
3 | """
4 | Basic tutorial 12: Streaming
5 | http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+12%3A+Streaming
6 | """
7 | import sys
8 | import pygst
9 | pygst.require("0.10")
10 | import gst
11 | import gobject
12 |
13 | class CustomData:
14 | is_live = False
15 | pipeline = None
16 | loop = None
17 |
18 | def cb_message(bus, msg, data):
19 | def error():
20 | print >> sys.stderr, ("Error: {0}".format(err.message))
21 | data.pipeline.set_state(gst.STATE_READY)
22 | data.loop.quit()
23 | def eos():
24 | data.pipeline.set(gst.STATE_READY)
25 | data.loop.quit()
26 | def buffering():
27 | percent = 0
28 | #If the stream is live, we do not care about buffering.
29 | if (data.is_live):
30 | return
31 | percent = msg.parse_buffering()
32 | sys.stdout.write("\rBuffering ({0}%)".format(percent))
33 | sys.stdout.flush()
34 | #Wait until buffering is complete before start/resume playing
35 | if (percent < 0):
36 | data.pipeline.set_state(gst.STATE_PAUSED)
37 | else:
38 | data.pipeline.set_state(gst.STATE_PLAYING)
39 | def clock_lost():
40 | #Get a new clock
41 | data.pipeline.set_state(gst.STATE_PAUSED)
42 | data.pipeline.set_state(gst.STATE_PLAYING)
43 | def default():
44 | pass
45 |
46 | handlers = dict({gst.MESSAGE_ERROR: error,
47 | gst.MESSAGE_EOS: eos,
48 | gst.MESSAGE_BUFFERING: buffering,
49 | gst.MESSAGE_CLOCK_LOST: clock_lost
50 | })
51 | if (handlers.has_key(msg.type)):
52 | handlers[msg.type]()
53 |
54 | data = CustomData()
55 | pipeline = gst.parse_launch('playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm')
56 | bus = pipeline.get_bus()
57 |
58 | #Start playing
59 | ret = pipeline.set_state(gst.STATE_PLAYING)
60 | if (ret == gst.STATE_CHANGE_FAILURE):
61 | print >> sys.stderr, ("Unable to set pipeline to the playing state")
62 | exit(-1)
63 | elif (ret == gst.STATE_CHANGE_NO_PREROLL):
64 | data.is_live = True
65 |
66 | main_loop = gobject.MainLoop(None, False)
67 | data.loop = main_loop
68 | data.pipeline = pipeline
69 |
70 | bus.add_signal_watch()
71 | bus.connect("message", cb_message, data)
72 | data.loop.run()
73 |
74 | pipeline.set_state(gst.STATE_PLAYING)
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/Other/0.10/Python/pygst-sdk-tutorials/basic-tutorial-12.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding:utf-8 -*-
3 | """
4 | Basic tutorial 12: Streaming
5 | http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+12%3A+Streaming
6 | """
7 | import sys
8 | import pygst
9 | pygst.require("0.10")
10 | import gst
11 | import gobject
12 |
13 | class CustomData:
14 | is_live = False
15 | pipeline = None
16 | loop = None
17 |
18 | def cb_message(bus, msg, data):
19 | if (msg.type == gst.MESSAGE_ERROR):
20 | err, debug = msg.parse_error()
21 | print >> sys.stderr, ("Error: {0}".format(err.message))
22 | data.pipeline.set_state(gst.STATE_READY)
23 | data.loop.quit()
24 | elif (msg.type == gst.MESSAGE_EOS):
25 | data.pipeline.set(gst.STATE_READY)
26 | data.loop.quit()
27 | elif (msg.type == gst.MESSAGE_BUFFERING):
28 | percent = 0
29 | if (data.is_live):
30 | return
31 | percent = msg.parse_buffering()
32 | sys.stdout.write("\rBuffering ({0}%)".format(percent))
33 | sys.stdout.flush()
34 | #Wait until buffering is complete before start/resume playing
35 | if (percent < 0):
36 | data.pipeline.set_state(gst.STATE_PAUSED)
37 | else:
38 | data.pipeline.set_state(gst.STATE_PLAYING)
39 | elif (msg.type == gst.MESSAGE_CLOCK_LOST):
40 | #Get a new clock
41 | data.pipeline.set_state(gst.STATE_PAUSED)
42 | data.pipeline.set_state(gst.STATE_PLAYING)
43 | else:
44 | pass
45 |
46 | data = CustomData()
47 | pipeline = gst.parse_launch('playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm')
48 | bus = pipeline.get_bus()
49 |
50 | #Start playing
51 | ret = pipeline.set_state(gst.STATE_PLAYING)
52 | if (ret == gst.STATE_CHANGE_FAILURE):
53 | print >> sys.stderr, ("Unable to set pipeline to the playing state")
54 | exit(-1)
55 | elif (ret == gst.STATE_CHANGE_NO_PREROLL):
56 | data.is_live = True
57 |
58 | main_loop = gobject.MainLoop(None, False)
59 | data.loop = main_loop
60 | data.pipeline = pipeline
61 |
62 | bus.add_signal_watch()
63 | bus.connect("message", cb_message, data)
64 | data.loop.run()
65 |
66 | pipeline.set_state(gst.STATE_PLAYING)
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/Other/0.10/Python/pygst-sdk-tutorials/basic-tutorial-2.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding:utf-8 -*-
3 | # GStreamer SDK Tutorials in Python
4 | #
5 | # basic-tutorial-2
6 | #
7 | """
8 | basic-tutorial-2: GStreamer concepts
9 | http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+2%3A+GStreamer+concepts
10 | """
11 |
12 | import sys
13 | import gst
14 |
15 | # Create the elements
16 | source = gst.element_factory_make("videotestsrc", "source")
17 | sink = gst.element_factory_make("autovideosink", "sink")
18 |
19 | # Create the empty pipeline
20 | pipeline = gst.Pipeline("test-pipeline")
21 |
22 | if not source or not sink or not pipeline:
23 | print >> sys.stderr, "Not all elements could be created."
24 | exit(-1)
25 |
26 | # Build the pipeline
27 | pipeline.add(source, sink)
28 | if not gst.element_link_many(source, sink):
29 | print >> sys.stderr, "Elements could not be linked."
30 | exit(-1)
31 |
32 | # Modify the source's properties
33 | source.set_property("pattern", 0)
34 |
35 | # Start playing
36 | ret = pipeline.set_state(gst.STATE_PLAYING)
37 | if ret == gst.STATE_CHANGE_FAILURE:
38 | print >> sys.stderr, "Unable to set the pipeline to the playing state."
39 | exit(-1)
40 |
41 | # Wait until error or EOS
42 | bus = pipeline.get_bus()
43 | msg = bus.timed_pop_filtered(gst.CLOCK_TIME_NONE, gst.MESSAGE_ERROR | gst.MESSAGE_EOS)
44 |
45 | # Parse message
46 | if (msg):
47 | if msg.type == gst.MESSAGE_ERROR:
48 | err, debug = msg.parse_error()
49 | print >> sys.stderr, "Error received from element %s: %s"% (msg.src.get_name(), err)
50 | print >> sys.stderr, "Debugging information: %s"% debug
51 | elif msg.type == gst.MESSAGE_EOS:
52 | print "End-Of-Stream reached."
53 | else:
54 | print >> sys.stderr, "Unexpected message received."
55 |
56 | # Free resources
57 | pipeline.set_state(gst.STATE_NULL)
58 |
--------------------------------------------------------------------------------
/Other/0.10/Python/pygst-sdk-tutorials/basic-tutorial-3.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding:utf-8 -*-
3 | # GStreamer SDK Tutorials in Python
4 | #
5 | # basic-tutorial-3
6 | #
7 | """
8 | basic-tutorial-3: Dynamic pipelines
9 | http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+3%3A+Dynamic+pipelines
10 | """
11 |
12 | import sys
13 | import gst
14 |
15 |
16 | data = dict()
17 |
18 | # Handler for the pad-added signa
19 | def pad_added_handler(src, new_pad, data):
20 | print "Received new pad '%s' from '%s':"%( new_pad.get_name(), src.get_name())
21 |
22 | # If our converter is already linked, we have nothing to do here
23 | if new_pad.is_linked():
24 | print " We are already linked. Ignoring."
25 | return
26 |
27 | # Check the new pad's type
28 | new_pad_type = new_pad.get_caps()[0].get_name()
29 | if not new_pad_type.startswith("audio/x-raw"):
30 | print " It has type '%s' which is not raw audio. Ignoring."% new_pad_type
31 | return
32 |
33 | # Attempt the link
34 | ret = new_pad.link(data["convert"].get_pad("sink"))
35 | return
36 |
37 |
38 | # Create the elements
39 | data["source"] = gst.element_factory_make("uridecodebin", "source")
40 | data["convert"] = gst.element_factory_make("audioconvert", "convert")
41 | data["sink"] = gst.element_factory_make("autoaudiosink", "sink")
42 |
43 | # Create the empty pipeline
44 | pipeline = gst.Pipeline("test-pipeline")
45 |
46 | if not data["source"] or not data["convert"] or not data["sink"] or not pipeline:
47 | print >> sys.stderr, "Not all elements could be created."
48 | exit(-1)
49 |
50 | # Build the pipeline
51 | # Note that we are NOT linking the source at this point. We will do it later.
52 | pipeline.add(data["source"], data["convert"], data["sink"])
53 | if not gst.element_link_many(data["convert"], data["sink"]):
54 | print >> sys.stderr, "Elements could not be linked."
55 | exit(-1)
56 |
57 | # Set the URI to play
58 | data["source"].set_property("uri", "http://docs.gstreamer.com/media/sintel_trailer-480p.webm")
59 |
60 | # Connect to the pad-added signal
61 | data["source"].connect("pad-added", pad_added_handler, data)
62 |
63 | # Start playing
64 | ret = pipeline.set_state(gst.STATE_PLAYING)
65 | if ret == gst.STATE_CHANGE_FAILURE:
66 | print >> sys.stderr, "Unable to set the pipeline to the playing state."
67 | exit(-1)
68 |
69 | # Wait until error or EOS
70 | bus = pipeline.get_bus()
71 |
72 | # Parse message
73 | while True:
74 | message = bus.timed_pop_filtered(gst.CLOCK_TIME_NONE, gst.MESSAGE_STATE_CHANGED | gst.MESSAGE_ERROR | gst.MESSAGE_EOS)
75 | if message.type == gst.MESSAGE_ERROR:
76 | err, debug = message.parse_error()
77 | print >> sys.stderr, "Error received from element %s: %s"% (message.src.get_name(), err)
78 | print >> sys.stderr, "Debugging information: %s"% debug
79 | break
80 | elif message.type == gst.MESSAGE_EOS:
81 | print "End-Of-Stream reached."
82 | break
83 | elif message.type == gst.MESSAGE_STATE_CHANGED:
84 | if isinstance(message.src, gst.Pipeline):
85 | old_state, new_state, pending_state = message.parse_state_changed()
86 | print ("Pipeline state changed from %s to %s."%
87 | (gst.element_state_get_name(old_state), gst.element_state_get_name (new_state)))
88 | else:
89 | print >> sys.stderr, "Unexpected message received."
90 |
91 | # Free resources
92 | pipeline.set_state(gst.STATE_NULL)
93 |
--------------------------------------------------------------------------------
/Other/0.10/Python/pygst-sdk-tutorials/basic-tutorial-7.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding:utf-8 -*-
3 | # GStreamer SDK Tutorials in Python
4 | #
5 | # basic-tutorial-7
6 | #
7 | """
8 | basic-tutorial-7: Multithreading and Pad Availability
9 | http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+7%3A+Multithreading+and+Pad+Availability
10 | """
11 |
12 | import sys
13 | import gst
14 |
15 | # Create the elements
16 | audio_source = gst.element_factory_make("audiotestsrc", "audio_source")
17 | tee = gst.element_factory_make("tee", "tee")
18 | audio_queue = gst.element_factory_make("queue", "audio_queue")
19 | audio_convert = gst.element_factory_make("audioconvert", "audio_convert")
20 | audio_resample = gst.element_factory_make("audioresample", "audio_resample")
21 | audio_sink = gst.element_factory_make("autoaudiosink", "audio_sink")
22 | video_queue = gst.element_factory_make("queue", "video_queue")
23 | visual = gst.element_factory_make("wavescope", "visual")
24 | video_convert = gst.element_factory_make("ffmpegcolorspace", "csp")
25 | video_sink = gst.element_factory_make("autovideosink", "video_sink")
26 |
27 | # Create the empty pipeline
28 | pipeline = gst.Pipeline("test-pipeline")
29 |
30 | if (not audio_source or not tee or not audio_queue or not audio_convert or not audio_resample
31 | or not audio_sink or not video_queue or not visual or not video_convert or not video_sink or not pipeline):
32 | print >> sys.stderr, "Not all elements could be created."
33 | exit(-1)
34 |
35 |
36 | # Configure elements
37 | audio_source.set_property("freq", 215.0)
38 | visual.set_property("shader", 0)
39 | visual.set_property("style", 1)
40 |
41 | # Link all elements that can be automatically linked because they have "Always" pads
42 |
43 | pipeline.add(audio_source, tee, audio_queue, audio_convert, audio_resample, audio_sink, video_queue, visual, video_convert, video_sink)
44 | if (not gst.element_link_many(audio_source, tee) or
45 | not gst.element_link_many(audio_queue, audio_convert, audio_resample, audio_sink) or
46 | not gst.element_link_many(video_queue, visual, video_convert, video_sink)):
47 | print >> sys.stderr, "Elements could not be linked."
48 | exit(-1)
49 |
50 | # Manually link the Tee, which has "Request" pads
51 | tee_audio_pad = tee.get_request_pad("src%d")
52 | print "Obtained request pad %s for audio branch."% tee_audio_pad.get_name()
53 | queue_audio_pad = audio_queue.get_static_pad("sink")
54 | tee_video_pad = tee.get_request_pad("src%d")
55 | print "Obtained request pad %s for video branch."% tee_video_pad.get_name()
56 | queue_video_pad = video_queue.get_static_pad("sink")
57 | if (tee_audio_pad.link(queue_audio_pad) != gst.PAD_LINK_OK or
58 | tee_video_pad.link(queue_video_pad) != gst.PAD_LINK_OK):
59 | print >> sys.stderr, "Tee could not be linked."
60 | exit(-1)
61 |
62 | # Start playing the pipeline
63 | ret = pipeline.set_state(gst.STATE_PLAYING)
64 |
65 | # Wait until error or EOS
66 | bus = pipeline.get_bus()
67 | msg = bus.timed_pop_filtered(gst.CLOCK_TIME_NONE, gst.MESSAGE_ERROR | gst.MESSAGE_EOS)
68 |
69 | # Free resources
70 | pipeline.set_state(gst.STATE_NULL)
71 |
--------------------------------------------------------------------------------
/Other/0.10/Python/pygst-sdk-tutorials/playback-tutorial-6.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding:utf-8 -*-
3 | """
4 | Playback tutorial 6: Audio visualization
5 | http://docs.gstreamer.com/display/GstSDK/Playback+tutorial+6%3A+Audio+visualization
6 | """
7 | import sys
8 | import pygst
9 | pygst.require("0.10")
10 | import gst
11 |
12 | #playbin2 flags
13 | class GstPlayFlags:
14 | GST_PLAY_FLAG_VIS = 1 << 3 # Enable rendering of visualizations when there is no video stream.
15 |
16 | #Return TRUE if this is a Visualization element
17 | def filter_vis_features(f):
18 | return (f.get_klass().find("Visualization") >= 0)
19 |
20 |
21 |
22 |
23 | selected_factory = None
24 |
25 | #Get a list of all visualization plugins
26 | defreg = gst.registry_get_default()
27 | list = [f for f in defreg.get_feature_list(gst.ElementFactory) if filter_vis_features(f)]
28 |
29 | #Print their names
30 | for factory in list:
31 | name = factory.get_longname()
32 | print (" " + name)
33 | if (not selected_factory or name.startswith("GOOM")):
34 | selected_factory = factory
35 |
36 | #Don't use the factory if it's still empty
37 | #e.g. no visualization plugins found
38 | if (not selected_factory):
39 | print >> sys.stderr, "No visualization plugins found!"
40 | exit(-1)
41 |
42 | #We have now selected a factory for the visualization element
43 | print ("Selected '{0}'".format(selected_factory.get_longname()))
44 | vis_plugin = selected_factory.create()
45 | if (not vis_plugin):
46 | exit(-1)
47 |
48 | #Build the pipeline
49 | pipeline = gst.parse_launch("playbin2 uri=http://radio.hbr1.com:19800/ambient.ogg")
50 |
51 | #Set the visualization flag
52 | flags = pipeline.get_property("flags")
53 | flags |= GstPlayFlags.GST_PLAY_FLAG_VIS
54 | pipeline.set_property("flags", flags)
55 |
56 | #Set vis plugin for playbin2
57 | pipeline.set_property("vis-plugin", vis_plugin)
58 |
59 | #Start playing
60 | pipeline.set_state(gst.STATE_PLAYING)
61 | bus = pipeline.get_bus()
62 | msg = bus.timed_pop_filtered(gst.CLOCK_TIME_NONE, gst.MESSAGE_ERROR | gst.MESSAGE_EOS)
63 |
64 | #Free resources
65 | pipeline.set_state(gst.STATE_NULL)
66 |
67 |
--------------------------------------------------------------------------------
/Other/0.10/Python/pygst-sdk-tutorials/playback-tutorial-7-exc.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding:utf-8 -*-
3 | """
4 | Playback tutorial 7: Custom playbin2 sinks -- Exercise
5 | http://docs.gstreamer.com/display/GstSDK/Playback+tutorial+7%3A+Custom+playbin2+sinks
6 | """
7 | import sys, os
8 | os.environ["GST_DEBUG"] = "2"
9 | import pygst
10 | pygst.require("0.10")
11 | import gst
12 |
13 | #Build the pipeline
14 | pipeline = gst.parse_launch("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm")
15 |
16 | #effect = gst.element_factory_make("solarize", "effect")
17 | effect = gst.element_factory_make("agingtv", "effect")
18 | videoconvert = gst.element_factory_make("ffmpegcolorspace", "videoconvert")
19 | videosink = gst.element_factory_make("autovideosink", "videosink")
20 |
21 | if (not effect or not videoconvert or not videosink):
22 | print >> sys.stderr, "Not all elements could be created"
23 | exit(-1)
24 |
25 | bin = gst.Bin("video_sink_bin")
26 | bin.add_many(effect, videoconvert, videosink)
27 | gst.element_link_many(effect, videoconvert, videosink)
28 | pad = effect.get_static_pad("sink")
29 | ghost_pad = gst.GhostPad("sink", pad)
30 | ghost_pad.set_active(True)
31 | bin.add_pad(ghost_pad)
32 |
33 | effect.set_property("scratch-lines", 19)
34 |
35 | pipeline.set_property("video-sink", bin)
36 |
37 | #Start playing
38 | pipeline.set_state(gst.STATE_PLAYING)
39 |
40 | #Wait until error or EOS
41 | bus = pipeline.get_bus()
42 | bus.timed_pop_filtered(gst.CLOCK_TIME_NONE, gst.MESSAGE_ERROR | gst.MESSAGE_EOS)
43 |
44 | #Free resources
45 | pipeline.set_state(gst.STATE_NULL)
46 |
--------------------------------------------------------------------------------
/Other/0.10/Python/pygst-sdk-tutorials/playback-tutorial-7.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding:utf-8 -*-
3 | """
4 | Playback tutorial 7: Custom playbin2 sinks
5 | http://docs.gstreamer.com/display/GstSDK/Playback+tutorial+7%3A+Custom+playbin2+sinks
6 | """
7 | import sys
8 | import pygst
9 | pygst.require("0.10")
10 | import gst
11 |
12 | #Build the pipeline
13 | pipeline = gst.parse_launch("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm")
14 |
15 | #Create the elements inside the sink bin
16 | equalizer = gst.element_factory_make("equalizer-3bands", "equalizer")
17 | convert = gst.element_factory_make("audioconvert", "convert")
18 | sink = gst.element_factory_make("autoaudiosink", "audio_sink")
19 | if (not equalizer or not convert or not sink):
20 | print >> sys.stderr, "Not all elements could be created"
21 | exit(-1)
22 |
23 | #Create the sink bin, add the elements and link them
24 | bin = gst.Bin("audio_sink_bin")
25 | bin.add_many(equalizer, convert, sink)
26 | gst.element_link_many(equalizer, convert, sink)
27 | pad = equalizer.get_static_pad("sink")
28 | ghost_pad = gst.GhostPad("sink", pad)
29 | ghost_pad.set_active(True)
30 | bin.add_pad(ghost_pad)
31 |
32 | #COnfigure the equalizer
33 | equalizer.set_property("band1", -24.0)
34 | equalizer.set_property("band2", -24.0)
35 |
36 | #Set playbin2's audio sink to be our sink
37 | pipeline.set_property("audio-sink", bin)
38 |
39 | #Start playing
40 | pipeline.set_state(gst.STATE_PLAYING)
41 |
42 | #Wait until error or EOS
43 | bus = pipeline.get_bus()
44 | bus.timed_pop_filtered(gst.CLOCK_TIME_NONE, gst.MESSAGE_ERROR | gst.MESSAGE_EOS)
45 |
46 | #Free resources
47 | pipeline.set_state(gst.STATE_NULL)
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Other/0.10/Python/pygst-sdk-tutorials/pygst-sdk-tutorials.pyproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | 2.0
6 | {e1377634-d364-4147-8561-6a23c3688c73}
7 |
8 | playback-tutorial-4.py
9 |
10 | .
11 | .
12 | 10.0
13 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/Other/0.10/Python/pygst-sdk-tutorials/pygst-sdk-tutorials.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "pygst-sdk-tutorials", "pygst-sdk-tutorials.pyproj", "{E1377634-D364-4147-8561-6A23C3688C73}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {E1377634-D364-4147-8561-6A23C3688C73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {E1377634-D364-4147-8561-6A23C3688C73}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {E1377634-D364-4147-8561-6A23C3688C73}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {E1377634-D364-4147-8561-6A23C3688C73}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/Other/0.10/Python/tee_and_rtmpsink.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding:utf-8 -*-
3 | #
4 | """
5 | # Use a queue to rtmpsink not block the pipeline
6 | """
7 |
8 | import sys
9 | import gst
10 |
11 | from datetime import datetime
12 | from time import sleep
13 |
14 |
15 |
16 | pipeline_str = """
17 | v4l2src name=src ! video/x-raw-yuv,framerate=24/1,width=640 ! tee name=t num-src-pads=2 !
18 | queue name=q1 ! ffmpegcolorspace !
19 | x264enc threads=0 bitrate=400 tune=zerolatency ! flvmux streamable=true ! queue leaky=2 max-size-buffers=0 max-size-bytes=0 max-size-time=500000 name=q !
20 | rtmpsink name=sink location="rtmp://fms.uvigo.es/live/directo2"
21 | t. ! queue name=q2 ! xvimagesink qos=false handle-events=false
22 | """
23 |
24 | # Create the empty pipeline
25 | pipeline = gst.parse_launch(pipeline_str)
26 | src = pipeline.get_by_name("src")
27 | sink = pipeline.get_by_name("sink")
28 | q = pipeline.get_by_name("q")
29 | q1 = pipeline.get_by_name("q1")
30 | q2 = pipeline.get_by_name("q2")
31 |
32 |
33 | if not pipeline or not src or not sink:
34 | print "Not all elements could be created."
35 | exit(-1)
36 |
37 | # Start playing
38 | ret = pipeline.set_state(gst.STATE_PLAYING)
39 | if ret == gst.STATE_CHANGE_FAILURE:
40 | print "Unable to set the pipeline to the playing state."
41 | exit(-1)
42 |
43 | print "Set the pipeline to the playing state."
44 |
45 | # Wait until error or EOS
46 | bus = pipeline.get_bus()
47 | bus.add_signal_watch()
48 |
49 | while True:
50 | message = bus.timed_pop_filtered(35 * gst.SECOND, gst.MESSAGE_ANY)
51 | if not message:
52 | print "DO IT !!", pipeline.get_clock().get_time()
53 | print q.get_property("current-level-buffers"), q.get_property("current-level-bytes"), q.get_property("current-level-time")
54 | #event = gst.event_new_eos()
55 | #sink.send_event(event)
56 | elif message.type == gst.MESSAGE_ERROR:
57 | err, debug = message.parse_error()
58 | print "Error received from element %s: %s"% (message.src.get_name(), err)
59 | print "Debugging information: %s"% debug
60 | break
61 | elif message.type == gst.MESSAGE_EOS:
62 | print " - gst.MESSAGE_EOS: End-Of-Stream reached."
63 | break
64 | elif message.type == gst.MESSAGE_STATE_CHANGED:
65 | old_state, new_state, pending_state = message.parse_state_changed()
66 | print (" - gst.MESSAGE_STATE_CHANGED: %s state changed from %s to %s."%
67 | (message.src.get_name(), gst.element_state_get_name(old_state), gst.element_state_get_name (new_state)))
68 | elif message.type == gst.MESSAGE_ELEMENT:
69 | print " - gst.MESSAGE_ELEMENT: src %s ."% message.src.get_name()
70 | else:
71 | print "Unexpected message (%s) received." % message.type
72 |
73 |
74 | # Free resources
75 | pipeline.set_state(gst.STATE_NULL)
76 |
--------------------------------------------------------------------------------
/Other/0.10/Shell/videoeffects.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # edgetv: EdgeTV effect
4 | gst-launch-0.10 v4l2src ! ffmpegcolorspace ! edgetv ! ffmpegcolorspace ! autovideosink
5 |
6 | # agingtv: AgingTV effect
7 | gst-launch-0.10 v4l2src ! ffmpegcolorspace ! agingtv ! ffmpegcolorspace ! autovideosink
8 |
9 | # dicetv: DiceTV effect
10 | gst-launch-0.10 v4l2src ! ffmpegcolorspace ! dicetv ! ffmpegcolorspace ! autovideosink
11 |
12 | # warptv: WarpTV effect
13 | gst-launch-0.10 v4l2src ! ffmpegcolorspace ! warptv ! ffmpegcolorspace ! autovideosink
14 |
15 | # shagadelictv: ShagadelicTV
16 | gst-launch-0.10 v4l2src ! ffmpegcolorspace ! shagadelictv ! ffmpegcolorspace ! autovideosink
17 |
18 | # vertigotv: VertigoTV effect
19 | gst-launch-0.10 v4l2src ! ffmpegcolorspace ! vertigotv ! ffmpegcolorspace ! autovideosink
20 |
21 | # revtv: RevTV effect
22 | gst-launch-0.10 v4l2src ! ffmpegcolorspace ! revtv ! ffmpegcolorspace ! autovideosink
23 |
24 | # quarktv: QuarkTV effect
25 | gst-launch-0.10 v4l2src ! ffmpegcolorspace ! quarktv ! ffmpegcolorspace ! autovideosink
26 |
27 | # optv: OpTV effect
28 | gst-launch-0.10 v4l2src ! ffmpegcolorspace ! optv ! ffmpegcolorspace ! autovideosink
29 |
30 | # radioactv: RadioacTV effect
31 | gst-launch-0.10 v4l2src ! ffmpegcolorspace ! radioactv ! ffmpegcolorspace ! autovideosink
32 |
33 | # streaktv: StreakTV effect
34 | gst-launch-0.10 v4l2src ! ffmpegcolorspace ! streaktv ! ffmpegcolorspace ! autovideosink
35 |
36 | # rippletv: RippleTV effect
37 | gst-launch-0.10 v4l2src ! ffmpegcolorspace ! rippletv ! ffmpegcolorspace ! autovideosink
38 |
39 |
--------------------------------------------------------------------------------
/Python/pygst-sdk-tutorials/README.md:
--------------------------------------------------------------------------------
1 | GStreamer SDK Tutorials in Python
2 | ===================
3 |
4 | Python version of gstreamer SDK [1] tutorials [2].
5 | The following sections introduce a series of tutorials designed to help you learn how to use GStreamer, the multi-platform, modular, open-source, media streaming framework.
6 |
7 | Tutorials
8 | ------------
9 |
10 | * Basic tutorial 1: Hello world!
11 | * Basic tutorial 2: GStreamer concepts
12 | * Basic tutorial 3: Dynamic pipelines
13 | * Basic tutorial 4: Time management
14 | * Basic tutorial 5: GUI toolkit integration
15 | * Basic tutorial 6: Media formats and Pad Capabilities
16 | * Basic tutorial 7: Multithreading and Pad Availability
17 | * Basic tutorial 8: Short-cutting the pipeline
18 | * Basic tutorial 9: Media information gathering
19 | * ..
20 |
21 | APIs
22 | ------------
23 |
24 | * Python GStreamer: http://pygstdocs.berlios.de/pygst-reference/index.html (Obsolete)
25 | * Python Gstreamer Introspection Bindings
26 | * GStreamer 1.0 Core Reference Manual: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/
27 | * GStreamer Base Plugins 0.10 Plugins Reference Manual: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/
28 |
29 |
30 | [1]: http://gstreamer.com/
31 | [2]: http://docs.gstreamer.com/display/GstSDK/Tutorials
32 |
--------------------------------------------------------------------------------
/Python/pygst-sdk-tutorials/basic-tutorial-1.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding:utf-8 -*-
3 | # GStreamer SDK Tutorials in Python
4 | #
5 | # basic-tutorial-1
6 | #
7 | """
8 | basic-tutorial-1: Hello world!
9 | http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+2%3A+GStreamer+concepts
10 | """
11 |
12 | from gi.repository import Gst
13 | Gst.init(None)
14 |
15 | # Build the pipeline
16 | pipeline = Gst.parse_launch(
17 | "playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm")
18 |
19 | # Start playing
20 | pipeline.set_state(Gst.State.PLAYING)
21 |
22 | # Wait until error or EOS
23 | bus = pipeline.get_bus()
24 | msg = bus.timed_pop_filtered(
25 | Gst.CLOCK_TIME_NONE, Gst.MessageType.ERROR | Gst.MessageType.EOS)
26 |
27 | # Free resources
28 | pipeline.set_state(Gst.State.NULL)
29 |
--------------------------------------------------------------------------------
/Python/pygst-sdk-tutorials/basic-tutorial-2.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding:utf-8 -*-
3 | # GStreamer SDK Tutorials in Python
4 | #
5 | # basic-tutorial-2
6 | #
7 | """
8 | basic-tutorial-2: GStreamer concepts
9 | http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+2%3A+GStreamer+concepts
10 | """
11 |
12 | import sys
13 | from gi.repository import Gst
14 | Gst.init(None)
15 |
16 | # Create the elements
17 | source = Gst.ElementFactory.make("videotestsrc", "source")
18 | sink = Gst.ElementFactory.make("autovideosink", "sink")
19 |
20 | # Create the empty pipeline
21 | pipeline = Gst.Pipeline.new("test-pipeline")
22 |
23 | if not source or not sink or not pipeline:
24 | print("Not all elements could be created.", file=sys.stderr)
25 | exit(-1)
26 |
27 | # Build the pipeline
28 | pipeline.add(source)
29 | pipeline.add(sink)
30 | if not Gst.Element.link(source, sink):
31 | print("Elements could not be linked.", file=sys.stderr)
32 | exit(-1)
33 |
34 | # Modify the source's properties
35 | source.set_property("pattern", 0)
36 |
37 | # Start playing
38 | ret = pipeline.set_state(Gst.State.PLAYING)
39 | if ret == Gst.StateChangeReturn.FAILURE:
40 | print("Unable to set the pipeline to the playing state.", file=sys.stderr)
41 | exit(-1)
42 |
43 | # Wait until error or EOS
44 | bus = pipeline.get_bus()
45 | msg = bus.timed_pop_filtered(
46 | Gst.CLOCK_TIME_NONE, Gst.MessageType.ERROR | Gst.MessageType.EOS)
47 |
48 | # Parse message
49 | if (msg):
50 | if msg.type == Gst.MessageType.ERROR:
51 | err, debug = msg.parse_error()
52 | print("Error received from element %s: %s" % (
53 | msg.src.get_name(), err), file=sys.stderr)
54 | print("Debugging information: %s" % debug, file=sys.stderr)
55 | elif msg.type == Gst.MessageType.EOS:
56 | print("End-Of-Stream reached.")
57 | else:
58 | print("Unexpected message received.", file=sys.stderr)
59 |
60 | # Free resources
61 | pipeline.set_state(Gst.State.NULL)
62 |
--------------------------------------------------------------------------------
/Python/pygst-tutorial/0.md:
--------------------------------------------------------------------------------
1 | Python GStreamer Tutorial
2 | =========================
3 |
4 | Jens Persson
5 |
6 | Version 0.10.3
7 |
8 | February 13, 2009
9 |
10 | Abstract
11 | --------
12 |
13 | This tutorial aims at giving a brief introduction to the GStreamer multimedia framework.
14 |
15 | Table of Contents
16 | -----------------
17 |
18 | 1. Introduction
19 | 2. Playbin
20 | 3. Pipeline
21 | 4. Src, sink, pad ... oh my!
22 | 5. Seeking (Not finished)
23 | 6. Capabilities (Not finished)
24 | 7. Videomixer (Not finished)
25 | 8. Webcam Viewer
26 | A. ChangeLog (Not finished)
27 |
--------------------------------------------------------------------------------
/Python/pygst-tutorial/1.md:
--------------------------------------------------------------------------------
1 | 1. Introduction
2 | ===============
3 |
4 | This tutorial is meant to be a quick way to get to know more about Gstreamer but it'll take some time to write it though because we don't know it ourselves ... yet. We're usually using GNU/Linux and GTK in the examples but we try to keep the GUI code to an absolute minimum so it should not get in the way. Just remember that Gstreamer depends heavily on Glib so you must make sure that the [Glib Mainloop](http://pygstdocs.berlios.de/pygobject-reference/class-glibmainloop.html) is running if you want to catch events on the bus. We take for granted that you are at least a fairly descent Python coder. For problems related to the Python language we redirect you over to [here](http://python.org/doc). :D
5 |
6 | As you may see this tutorial is far from done and we are always looking for new people to join this project. If you want to write a chapter just do it and submit it to some of the people having commiting access to the source. You find us [here](http://developer.berlios.de/projects/pygstdocs/). TIA
7 |
8 | There are also some example coding distributed with the PyGST source which you may browse [here](http://cgit.freedesktop.org/gstreamer/gst-python/tree/examples).
9 |
10 | Gstreamer comes with a few handy CLI programs that helps you find and try out what you need in a very fast and convenient way. With "gst-inspect" you can track highlevel elements which are shipped with the various plugins packages.
11 |
12 | $ man gst-inspect-1.0
13 |
14 | If you are looking for an element but you don't know its name you can use it with grep. Getting the elements that handles ie mp3 is done like this:
15 |
16 | $ gst-inspect-1.0 | grep mp3
17 |
18 | Playbin is an autoplugger element which usually plays anything you throw at it, if you have the appropriate plugins installed.
19 |
20 | $ gst-inspect-1.0 playbin
21 |
22 | You can also run pipelines directly in a terminal with "gst-launch":
23 |
24 | $ man gst-launch-1.0
25 |
26 | For playing a file with playbin:
27 |
28 | $ gst-launch-1.0 playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm
29 |
30 | It's also possible to link elements together with "!":
31 |
32 | $ gst-launch-1.0 audiotestsrc ! alsasink
33 |
34 | You may also make different streams in the pipeline:
35 |
36 | $ gst-launch-1.0 audiotestsrc ! alsasink videotestsrc ! xvimagesink
37 |
38 | If you are using the "name" property you may use the same element more than once. Just put a "." after its name, eg with oggmux here.
39 |
40 | $ gst-launch-1.0 audiotestsrc ! vorbisenc ! oggmux name=mux ! filesink location=file.ogg videotestsrc ! theoraenc ! mux.
41 |
42 | In the next chapter we will show you more examples with Playbin.
43 |
--------------------------------------------------------------------------------
/Python/pygst-tutorial/6.md:
--------------------------------------------------------------------------------
1 | 6. Capabilities
2 | ===============
3 |
4 | Capabilities, gst.Caps, is a container where you may store information that you may pass on to a gst.PadTemplate. When you set the pipeline state to either playing or paused the elements pads negotiates what caps to use for the stream. Now the following pipeline works perfectly:
5 |
6 | $ gst-launch-0.10 videotestsrc ! video/x-raw-yuv, width=320, height=240 ! xvimagesink
7 |
8 | But if you try to switch out the xvimagesink for a ximagesink you will notice that it wouldn't work. That's because ximagesink can't handle video/x-raw-yuv so you must put in an element BEFORE in the pipeline that does.
9 |
10 | $ gst-launch-0.10 videotestsrc ! video/x-raw-yuv, width=320, height=240 ! ffmpegcolorspace ! ximagesink
11 |
12 | And as ximagesink does not support hardware scaling you have to throw in a videoscale element too if you want software scaling.
13 |
14 | $ gst-launch-0.10 videotestsrc ! video/x-raw-yuv, width=320, height=240 ! videoscale ! ffmpegcolorspace ! ximagesink
15 |
16 | To put the above examples in code you have to put the caps in a capsfilter element.
17 |
18 | Example 6.1
19 |
20 |
21 |
22 | A frequently asked question is how to find out what resolution a file has and one way to do it is to check the caps on a decodebin element in paused state.
23 |
24 | Example 6.2
25 |
26 |
27 | Note: The examples here in this tutorial have grown a bit lately and it's not easy to show working gstreamer stuff in not so many lines but I'll try as hard as I can to do just that. Maybe we have to have the code in separate files that you may take a look at if you find anything interesting. The examples share much code too and when the numbers of chapters beefs up so does the readers knowledge and they can make sense out of just a few lines of code instead of runable code examples. Well, time will tell how far we gets.
28 |
29 | In this example we will use the playbin from example 2.2 and switch its video-sink out for our own homemade bin, stuffed with some goodies. Now, let's say that you run a tv-station and you want to have your logo in the top right corner of the screen. For that you can use a textoverlay but for the fonts to be the exact same size on the screen no matter what kind of resolution the source has you have to specify a width so everything is scaled according to that.
30 |
31 | Example 6.3
32 |
--------------------------------------------------------------------------------
/Python/pygst-tutorial/7.md:
--------------------------------------------------------------------------------
1 | 7. Videomixer
2 | ============
3 |
4 | The videomixer element makes it possible to mix different videostreams together. Here is a CLI example:
5 |
6 | $ gst-launch-0.10 filesrc location=tvlogo.png ! pngdec ! alphacolor ! ffmpegcolorspace ! videobox border-alpha=0 alpha=0.5 top=-20 left=-200 ! videomixer name=mix ! ffmpegcolorspace ! autovideosink videotestsrc ! video/x-raw-yuv, width=320, height=240 ! mix.
7 |
8 | You have to make a PNG image (100x100 px) to be able to run it. With the videobox element you can move the image around and add more alpha channels.
9 |
10 | NEW COMPETITION! I can't figure out how to make a transparent alpha channel for the PNG in the pipeline above so if anyone makes it work the prize from example 3.2 will be given to this winner instead as the other one passed. TIA
11 |
12 | UPDATE! An anonymous dude solved the problem with an alphacolor element, many thanks man.
13 |
14 | In the next example we take the now working Mpeg2-Player -> (changed to MKV-Player) from example 3.2 and pump it with the stuff shown above.
15 |
16 | Example 7.1
17 |
18 | We implemented a new videomixer example that plays MP4 videos encoded with h264 and aac codecs with the PNG image. demuxer: qtdemux, decoders: avdec_h264 & avdec_aac
19 |
20 | Example 7.2
--------------------------------------------------------------------------------
/Python/pygst-tutorial/8.md:
--------------------------------------------------------------------------------
1 | 8. Webcam Viewer
2 | ================
3 |
4 | A simple webcam example I found on the net, more text later.
5 |
6 | Example 8.1
7 |
8 |
9 | #!/usr/bin/env python
10 |
11 | import sys, os
12 | import gi
13 | gi.require_version('Gst', '1.0')
14 | from gi.repository import Gst, GObject, Gtk, Gdk
15 |
16 | # Needed for window.get_xid(), xvimagesink.set_window_handle(), respectively:
17 | from gi.repository import GdkX11, GstVideo
18 |
19 |
20 | class GTK_Main(object):
21 |
22 | def __init__(self):
23 | window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
24 | window.set_title("Webcam-Viewer")
25 | window.set_default_size(500, 400)
26 | window.connect("destroy", Gtk.main_quit, "WM destroy")
27 | vbox = Gtk.VBox()
28 | window.add(vbox)
29 | self.movie_window = Gtk.DrawingArea()
30 | vbox.add(self.movie_window)
31 | hbox = Gtk.HBox()
32 | vbox.pack_start(hbox, False, False, 0)
33 | hbox.set_border_width(10)
34 | hbox.pack_start(Gtk.Label(), False, False, 0)
35 | self.button = Gtk.Button("Start")
36 | self.button.connect("clicked", self.start_stop)
37 | hbox.pack_start(self.button, False, False, 0)
38 | self.button2 = Gtk.Button("Quit")
39 | self.button2.connect("clicked", self.exit)
40 | hbox.pack_start(self.button2, False, False, 0)
41 | hbox.add(Gtk.Label())
42 | window.show_all()
43 |
44 | # Set up the gstreamer pipeline
45 | self.player = Gst.parse_launch ("v4l2src ! autovideosink")
46 |
47 | bus = self.player.get_bus()
48 | bus.add_signal_watch()
49 | bus.enable_sync_message_emission()
50 | bus.connect("message", self.on_message)
51 | bus.connect("sync-message::element", self.on_sync_message)
52 |
53 | def start_stop(self, w):
54 | if self.button.get_label() == "Start":
55 | self.button.set_label("Stop")
56 | self.player.set_state(Gst.State.PLAYING)
57 | else:
58 | self.player.set_state(Gst.State.NULL)
59 | self.button.set_label("Start")
60 |
61 | def exit(self, widget, data=None):
62 | Gtk.main_quit()
63 |
64 | def on_message(self, bus, message):
65 | t = message.type
66 | if t == Gst.MessageType.EOS:
67 | self.player.set_state(Gst.State.NULL)
68 | self.button.set_label("Start")
69 | elif t == Gst.MessageType.ERROR:
70 | err, debug = message.parse_error()
71 | print "Error: %s" % err, debug
72 | self.player.set_state(Gst.State.NULL)
73 | self.button.set_label("Start")
74 |
75 | def on_sync_message(self, bus, message):
76 | if message.get_structure().get_name() == 'prepare-window-handle':
77 | imagesink = message.src
78 | imagesink.set_property("force-aspect-ratio", True)
79 | Gdk.threads_enter()
80 | imagesink.set_window_handle(self.movie_window.get_property('window').get_xid())
81 | Gdk.threads_leave()
82 |
83 |
84 | GObject.threads_init()
85 | Gst.init(None)
86 | GTK_Main()
87 | Gtk.main()
88 |
--------------------------------------------------------------------------------
/Python/pygst-tutorial/example21.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import sys, os
4 | import gi
5 | gi.require_version('Gst', '1.0')
6 | from gi.repository import Gst, GObject, Gtk
7 |
8 | class GTK_Main(object):
9 |
10 | def __init__(self):
11 | window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
12 | window.set_title("Audio-Player")
13 | window.set_default_size(300, -1)
14 | window.connect("destroy", Gtk.main_quit, "WM destroy")
15 | vbox = Gtk.VBox()
16 | window.add(vbox)
17 | self.entry = Gtk.Entry()
18 | vbox.pack_start(self.entry, False, True, 0)
19 | self.button = Gtk.Button("Start")
20 | self.button.connect("clicked", self.start_stop)
21 | vbox.add(self.button)
22 | window.show_all()
23 |
24 | self.player = Gst.ElementFactory.make("playbin", "player")
25 | fakesink = Gst.ElementFactory.make("fakesink", "fakesink")
26 | self.player.set_property("video-sink", fakesink)
27 | bus = self.player.get_bus()
28 | bus.add_signal_watch()
29 | bus.connect("message", self.on_message)
30 |
31 | def start_stop(self, w):
32 | if self.button.get_label() == "Start":
33 | filepath = self.entry.get_text()
34 | if os.path.isfile(filepath):
35 | self.button.set_label("Stop")
36 | self.player.set_property("uri", "file://" + filepath)
37 | self.player.set_state(Gst.State.PLAYING)
38 | else:
39 | self.player.set_state(Gst.State.NULL)
40 | self.button.set_label("Start")
41 |
42 | def on_message(self, bus, message):
43 | t = message.type
44 | if t == Gst.MessageType.EOS:
45 | self.player.set_state(Gst.State.NULL)
46 | self.button.set_label("Start")
47 | elif t == Gst.MessageType.ERROR:
48 | self.player.set_state(Gst.State.NULL)
49 | err, debug = message.parse_error()
50 | print "Error: %s" % err, debug
51 | self.button.set_label("Start")
52 |
53 |
54 | Gst.init(None)
55 | GTK_Main()
56 | GObject.threads_init()
57 | Gtk.main()
58 |
--------------------------------------------------------------------------------
/Python/pygst-tutorial/example22.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import sys, os
4 | import gi
5 | gi.require_version('Gst', '1.0')
6 | from gi.repository import Gst, GObject, Gtk, Gdk
7 |
8 | # Needed for window.get_xid(), xvimagesink.set_window_handle(), respectively:
9 | from gi.repository import GdkX11, GstVideo
10 |
11 | class GTK_Main(object):
12 |
13 | def __init__(self):
14 | window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
15 | window.set_title("Video-Player")
16 | window.set_default_size(500, 400)
17 | window.connect("destroy", Gtk.main_quit, "WM destroy")
18 | vbox = Gtk.VBox()
19 | window.add(vbox)
20 | hbox = Gtk.HBox()
21 | vbox.pack_start(hbox, False, False, 0)
22 | self.entry = Gtk.Entry()
23 | hbox.add(self.entry)
24 | self.button = Gtk.Button("Start")
25 | hbox.pack_start(self.button, False, False, 0)
26 | self.button.connect("clicked", self.start_stop)
27 | self.movie_window = Gtk.DrawingArea()
28 | vbox.add(self.movie_window)
29 | window.show_all()
30 |
31 | self.player = Gst.ElementFactory.make("playbin", "player")
32 | bus = self.player.get_bus()
33 | bus.add_signal_watch()
34 | bus.enable_sync_message_emission()
35 | bus.connect("message", self.on_message)
36 | bus.connect("sync-message::element", self.on_sync_message)
37 |
38 | def start_stop(self, w):
39 | if self.button.get_label() == "Start":
40 | filepath = self.entry.get_text()
41 | if os.path.isfile(filepath):
42 | self.button.set_label("Stop")
43 | self.player.set_property("uri", "file://" + filepath)
44 | self.player.set_state(Gst.State.PLAYING)
45 | else:
46 | self.player.set_state(Gst.State.NULL)
47 | self.movie_window.override_background_color(0, Gdk.RGBA.from_color(Gdk.color_parse("black")))
48 | self.button.set_label("Start")
49 |
50 | def on_message(self, bus, message):
51 | t = message.type
52 | if t == Gst.MessageType.EOS:
53 | self.player.set_state(Gst.State.NULL)
54 | self.button.set_label("Start")
55 | elif t == Gst.MessageType.ERROR:
56 | self.player.set_state(Gst.State.NULL)
57 | err, debug = message.parse_error()
58 | print "Error: %s" % err, debug
59 | self.button.set_label("Start")
60 |
61 | def on_sync_message(self, bus, message):
62 | if message.get_structure().get_name() == 'prepare-window-handle':
63 | imagesink = message.src
64 | imagesink.set_property("force-aspect-ratio", True)
65 | imagesink.set_window_handle(self.movie_window.get_property('window').get_xid())
66 |
67 |
68 | GObject.threads_init()
69 | Gst.init(None)
70 | GTK_Main()
71 | Gtk.main()
72 |
--------------------------------------------------------------------------------
/Python/pygst-tutorial/example22b.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import os
4 | import gi
5 | gi.require_version('Gst', '1.0')
6 | from gi.repository import Gst, GObject, Gtk, Gdk
7 |
8 | # Needed for window.get_xid(), xvimagesink.set_window_handle(), respectively:
9 | from gi.repository import GdkX11, GstVideo
10 |
11 | class GTK_Main(object):
12 |
13 | def __init__(self):
14 | window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
15 | window.set_title("Video-Player")
16 | window.set_default_size(500, 400)
17 | window.connect("destroy", Gtk.main_quit, "WM destroy")
18 | vbox = Gtk.VBox()
19 | window.add(vbox)
20 | hbox = Gtk.HBox()
21 | vbox.pack_start(hbox, False, False, 0)
22 | self.entry = Gtk.Entry()
23 | hbox.add(self.entry)
24 | self.button = Gtk.Button("Start")
25 | hbox.pack_start(self.button, False, False, 0)
26 | self.button.connect("clicked", self.start_stop)
27 | self.movie_window = Gtk.DrawingArea()
28 | vbox.add(self.movie_window)
29 | window.show_all()
30 |
31 | self.player = Gst.ElementFactory.make("playbin", "player")
32 |
33 | self.bin = Gst.Bin.new("my-bin")
34 | timeoverlay = Gst.ElementFactory.make("timeoverlay")
35 | self.bin.add(timeoverlay)
36 | pad = timeoverlay.get_static_pad("video_sink")
37 | ghostpad = Gst.GhostPad.new("sink", pad)
38 | self.bin.add_pad(ghostpad)
39 | videosink = Gst.ElementFactory.make("autovideosink")
40 | self.bin.add(videosink)
41 | timeoverlay.link(videosink)
42 | self.player.set_property("video-sink", self.bin)
43 |
44 | bus = self.player.get_bus()
45 | bus.add_signal_watch()
46 | bus.enable_sync_message_emission()
47 | bus.connect("message", self.on_message)
48 | bus.connect("sync-message::element", self.on_sync_message)
49 |
50 | def start_stop(self, w):
51 | if self.button.get_label() == "Start":
52 | filepath = self.entry.get_text()
53 | if os.path.isfile(filepath):
54 | self.button.set_label("Stop")
55 | self.player.set_property("uri", "file://" + filepath)
56 | self.player.set_state(Gst.State.PLAYING)
57 | else:
58 | self.player.set_state(Gst.State.NULL)
59 | self.movie_window.override_background_color(0, Gdk.RGBA.from_color(Gdk.color_parse("black")))
60 | self.button.set_label("Start")
61 |
62 | def on_message(self, bus, message):
63 | t = message.type
64 | if t == Gst.MessageType.EOS:
65 | self.player.set_state(Gst.State.NULL)
66 | self.button.set_label("Start")
67 | elif t == Gst.MessageType.ERROR:
68 | self.player.set_state(Gst.State.NULL)
69 | err, debug = message.parse_error()
70 | print "Error: %s" % err, debug
71 | self.button.set_label("Start")
72 |
73 | def on_sync_message(self, bus, message):
74 | if message.get_structure().get_name() == 'prepare-window-handle':
75 | imagesink = message.src
76 | imagesink.set_property("force-aspect-ratio", True)
77 | imagesink.set_window_handle(self.movie_window.get_property('window').get_xid())
78 |
79 | GObject.threads_init()
80 | Gst.init(None)
81 | GTK_Main()
82 | Gtk.main()
83 |
--------------------------------------------------------------------------------
/Python/pygst-tutorial/example23.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import sys, os, time, thread
4 | import gi
5 | gi.require_version('Gst', '1.0')
6 | from gi.repository import Gst, GLib, GObject
7 |
8 | class CLI_Main(object):
9 |
10 | def __init__(self):
11 | self.player = Gst.ElementFactory.make("playbin", "player")
12 | fakesink = Gst.ElementFactory.make("fakesink", "fakesink")
13 | self.player.set_property("video-sink", fakesink)
14 | bus = self.player.get_bus()
15 | bus.add_signal_watch()
16 | bus.connect("message", self.on_message)
17 |
18 | def on_message(self, bus, message):
19 | t = message.type
20 | if t == Gst.MessageType.EOS:
21 | self.player.set_state(Gst.State.NULL)
22 | self.playmode = False
23 | elif t == Gst.MessageType.ERROR:
24 | self.player.set_state(Gst.State.NULL)
25 | err, debug = message.parse_error()
26 | print "Error: %s" % err, debug
27 | self.playmode = False
28 |
29 | def start(self):
30 | for filepath in sys.argv[1:]:
31 | if os.path.isfile(filepath):
32 | self.playmode = True
33 | self.player.set_property("uri", "file://" + filepath)
34 | self.player.set_state(Gst.State.PLAYING)
35 | while self.playmode:
36 | time.sleep(1)
37 | time.sleep(1)
38 | loop.quit()
39 |
40 | GObject.threads_init()
41 | Gst.init(None)
42 | mainclass = CLI_Main()
43 | thread.start_new_thread(mainclass.start, ())
44 | loop = GLib.MainLoop()
45 | loop.run()
46 |
--------------------------------------------------------------------------------
/Python/pygst-tutorial/example31.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import sys, os
4 | import gi
5 | gi.require_version('Gst', '1.0')
6 | from gi.repository import Gst, GObject, Gtk
7 |
8 | class GTK_Main(object):
9 |
10 | def __init__(self):
11 | window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
12 | window.set_title("MP3-Player")
13 | window.set_default_size(400, 200)
14 | window.connect("destroy", Gtk.main_quit, "WM destroy")
15 | vbox = Gtk.VBox()
16 | window.add(vbox)
17 | self.entry = Gtk.Entry()
18 | vbox.pack_start(self.entry, False, True, 0)
19 | self.button = Gtk.Button("Start")
20 | self.button.connect("clicked", self.start_stop)
21 | vbox.add(self.button)
22 | window.show_all()
23 |
24 | self.player = Gst.Pipeline.new("player")
25 | source = Gst.ElementFactory.make("filesrc", "file-source")
26 | decoder = Gst.ElementFactory.make("mad", "mp3-decoder")
27 | conv = Gst.ElementFactory.make("audioconvert", "converter")
28 | sink = Gst.ElementFactory.make("alsasink", "alsa-output")
29 |
30 | self.player.add(source)
31 | self.player.add(decoder)
32 | self.player.add(conv)
33 | self.player.add(sink)
34 | source.link(decoder)
35 | decoder.link(conv)
36 | conv.link(sink)
37 |
38 | bus = self.player.get_bus()
39 | bus.add_signal_watch()
40 | bus.connect("message", self.on_message)
41 |
42 | def start_stop(self, w):
43 | if self.button.get_label() == "Start":
44 | filepath = self.entry.get_text()
45 | if os.path.isfile(filepath):
46 | self.button.set_label("Stop")
47 | self.player.get_by_name("file-source").set_property("location", filepath)
48 | self.player.set_state(Gst.State.PLAYING)
49 | else:
50 | self.player.set_state(Gst.State.NULL)
51 | self.button.set_label("Start")
52 |
53 | def on_message(self, bus, message):
54 | t = message.type
55 | if t == Gst.MessageType.EOS:
56 | self.player.set_state(Gst.State.NULL)
57 | self.button.set_label("Start")
58 | elif t == Gst.MessageType.ERROR:
59 | self.player.set_state(Gst.State.NULL)
60 | self.button.set_label("Start")
61 | err, debug = message.parse_error()
62 | print "Error: %s" % err, debug
63 |
64 | Gst.init(None)
65 | GTK_Main()
66 | GObject.threads_init()
67 | Gtk.main()
68 |
--------------------------------------------------------------------------------
/Python/pygst-tutorial/example4.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import sys, os
4 | import gi
5 | gi.require_version('Gst', '1.0')
6 | from gi.repository import Gst, GObject, Gtk
7 |
8 | class GTK_Main(object):
9 |
10 | def __init__(self):
11 | window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
12 | window.set_title("Vorbis-Player")
13 | window.set_default_size(500, 200)
14 | window.connect("destroy", Gtk.main_quit, "WM destroy")
15 | vbox = Gtk.VBox()
16 | window.add(vbox)
17 | self.entry = Gtk.Entry()
18 | vbox.pack_start(self.entry, False, False, 0)
19 | self.button = Gtk.Button("Start")
20 | vbox.add(self.button)
21 | self.button.connect("clicked", self.start_stop)
22 | window.show_all()
23 |
24 | self.player = Gst.Pipeline.new("player")
25 | source = Gst.ElementFactory.make("filesrc", "file-source")
26 | demuxer = Gst.ElementFactory.make("oggdemux", "demuxer")
27 | demuxer.connect("pad-added", self.demuxer_callback)
28 | self.audio_decoder = Gst.ElementFactory.make("vorbisdec", "vorbis-decoder")
29 | audioconv = Gst.ElementFactory.make("audioconvert", "converter")
30 | audiosink = Gst.ElementFactory.make("autoaudiosink", "audio-output")
31 |
32 | self.player.add(source)
33 | self.player.add(demuxer)
34 | self.player.add(self.audio_decoder)
35 | self.player.add(audioconv)
36 | self.player.add(audiosink)
37 |
38 | source.link(demuxer)
39 | self.audio_decoder.link(audioconv)
40 | audioconv.link(audiosink)
41 |
42 | bus = self.player.get_bus()
43 | bus.add_signal_watch()
44 | bus.connect("message", self.on_message)
45 |
46 | def start_stop(self, w):
47 | if self.button.get_label() == "Start":
48 | filepath = self.entry.get_text()
49 | if os.path.isfile(filepath):
50 | self.button.set_label("Stop")
51 | self.player.get_by_name("file-source").set_property("location", filepath)
52 | self.player.set_state(Gst.State.PLAYING)
53 | else:
54 | self.player.set_state(Gst.State.NULL)
55 | self.button.set_label("Start")
56 |
57 | def on_message(self, bus, message):
58 | t = message.type
59 | if t == Gst.MessageType.EOS:
60 | self.player.set_state(Gst.State.NULL)
61 | self.button.set_label("Start")
62 | elif t == Gst.MessageType.ERROR:
63 | err, debug = message.parse_error()
64 | print "Error: %s" % err, debug
65 | self.player.set_state(Gst.State.NULL)
66 | self.button.set_label("Start")
67 |
68 | def demuxer_callback(self, demuxer, pad):
69 | adec_pad = self.audio_decoder.get_static_pad("sink")
70 | pad.link(adec_pad)
71 |
72 |
73 | GObject.threads_init()
74 | Gst.init(None)
75 | GTK_Main()
76 | Gtk.main()
77 |
--------------------------------------------------------------------------------
/Python/pygst-tutorial/example61.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import gi
4 | gi.require_version("Gst", "1.0")
5 | from gi.repository import Gst, GObject, Gtk
6 |
7 | class GTK_Main:
8 |
9 | def __init__(self):
10 | window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
11 | window.set_title("Videotestsrc-Player")
12 | window.set_default_size(300, -1)
13 | window.connect("destroy", Gtk.main_quit, "WM destroy")
14 | vbox = Gtk.VBox()
15 | window.add(vbox)
16 | self.button = Gtk.Button("Start")
17 | self.button.connect("clicked", self.start_stop)
18 | vbox.add(self.button)
19 | window.show_all()
20 |
21 | self.player = Gst.Pipeline.new("player")
22 | source = Gst.ElementFactory.make("videotestsrc", "video-source")
23 | sink = Gst.ElementFactory.make("xvimagesink", "video-output")
24 | caps = Gst.Caps.from_string("video/x-raw, width=320, height=230")
25 | filter = Gst.ElementFactory.make("capsfilter", "filter")
26 | filter.set_property("caps", caps)
27 | for ele in [source, filter, sink]:
28 | self.player.add(ele)
29 | source.link(filter)
30 | filter.link(sink)
31 |
32 | def start_stop(self, w):
33 | if self.button.get_label() == "Start":
34 | self.button.set_label("Stop")
35 | self.player.set_state(Gst.State.PLAYING)
36 | else:
37 | self.player.set_state(Gst.State.NULL)
38 | self.button.set_label("Start")
39 |
40 | GObject.threads_init()
41 | Gst.init(None)
42 | GTK_Main()
43 | Gtk.main()
44 |
--------------------------------------------------------------------------------
/Python/pygst-tutorial/example62.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import os
4 | import gi
5 | gi.require_version("Gst", "1.0")
6 | from gi.repository import Gst, GObject, Gtk
7 |
8 | class GTK_Main:
9 |
10 | def __init__(self):
11 | window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
12 | window.set_title("Resolutionchecker")
13 | window.set_default_size(300, -1)
14 | window.connect("destroy", Gtk.main_quit, "WM destroy")
15 | vbox = Gtk.VBox()
16 | window.add(vbox)
17 | self.entry = Gtk.Entry()
18 | vbox.pack_start(self.entry, False, True, 0)
19 | self.button = Gtk.Button("Check")
20 | self.button.connect("clicked", self.start_stop)
21 | vbox.add(self.button)
22 | window.show_all()
23 |
24 | self.player = Gst.Pipeline.new("player")
25 | source = Gst.ElementFactory.make("filesrc", "file-source")
26 | decoder = Gst.ElementFactory.make("decodebin", "decoder")
27 | decoder.connect("pad-added", self.decoder_callback)
28 | self.fakea = Gst.ElementFactory.make("fakesink", "fakea")
29 | self.fakev = Gst.ElementFactory.make("fakesink", "fakev")
30 | for ele in [source, decoder, self.fakea, self.fakev]:
31 | self.player.add(ele)
32 | source.link(decoder)
33 | bus = self.player.get_bus()
34 | bus.add_signal_watch()
35 | bus.connect("message", self.on_message)
36 |
37 | def start_stop(self, w):
38 | filepath = self.entry.get_text()
39 | if os.path.isfile(filepath):
40 | self.player.set_state(Gst.State.NULL)
41 | self.player.get_by_name("file-source").set_property("location", filepath)
42 | self.player.set_state(Gst.State.PAUSED)
43 |
44 | def on_message(self, bus, message):
45 | typ = message.type
46 | if typ == Gst.MessageType.STATE_CHANGED:
47 | if message.parse_state_changed()[1] == Gst.State.PAUSED:
48 | decoder = self.player.get_by_name("decoder")
49 | for pad in decoder.srcpads:
50 | # caps = pad.query_caps(None)
51 | caps = pad.get_current_caps()
52 | structure_name = caps.to_string()
53 | width = caps.get_structure(0).get_int('width')[1]
54 | height = caps.get_structure(0).get_int('height')[1]
55 | if structure_name.startswith("video") and len(str(width)) < 6:
56 | print "Width:%d, Height:%d" %(width, height)
57 | self.player.set_state(Gst.State.NULL)
58 | break
59 | elif typ == Gst.MessageType.ERROR:
60 | err, debug = message.parse_error()
61 | print "Error: %s" % err, debug
62 | self.player.set_state(Gst.State.NULL)
63 |
64 | def decoder_callback(self, decoder, pad):
65 | caps = pad.query_caps(None)
66 | structure_name = caps.to_string()
67 | if structure_name.startswith("video"):
68 | fv_pad = self.fakev.get_static_pad("sink")
69 | pad.link(fv_pad)
70 | elif structure_name.startswith("audio"):
71 | fa_pad = self.fakea.get_static_pad("sink")
72 | pad.link(fa_pad)
73 |
74 | GObject.threads_init()
75 | Gst.init(None)
76 | GTK_Main()
77 | Gtk.main()
--------------------------------------------------------------------------------
/Python/pygst-tutorial/example8.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import sys, os
4 | import gi
5 | gi.require_version('Gst', '1.0')
6 | from gi.repository import Gst, GObject, Gtk, Gdk
7 |
8 | # Needed for window.get_xid(), xvimagesink.set_window_handle(), respectively:
9 | from gi.repository import GdkX11, GstVideo
10 |
11 |
12 | class GTK_Main(object):
13 |
14 | def __init__(self):
15 | window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
16 | window.set_title("Webcam-Viewer")
17 | window.set_default_size(500, 400)
18 | window.connect("destroy", Gtk.main_quit, "WM destroy")
19 | vbox = Gtk.VBox()
20 | window.add(vbox)
21 | self.movie_window = Gtk.DrawingArea()
22 | vbox.add(self.movie_window)
23 | hbox = Gtk.HBox()
24 | vbox.pack_start(hbox, False, False, 0)
25 | hbox.set_border_width(10)
26 | hbox.pack_start(Gtk.Label(), False, False, 0)
27 | self.button = Gtk.Button("Start")
28 | self.button.connect("clicked", self.start_stop)
29 | hbox.pack_start(self.button, False, False, 0)
30 | self.button2 = Gtk.Button("Quit")
31 | self.button2.connect("clicked", self.exit)
32 | hbox.pack_start(self.button2, False, False, 0)
33 | hbox.add(Gtk.Label())
34 | window.show_all()
35 |
36 | # Set up the gstreamer pipeline
37 | self.player = Gst.parse_launch ("v4l2src ! autovideosink")
38 |
39 | bus = self.player.get_bus()
40 | bus.add_signal_watch()
41 | bus.enable_sync_message_emission()
42 | bus.connect("message", self.on_message)
43 | bus.connect("sync-message::element", self.on_sync_message)
44 |
45 | def start_stop(self, w):
46 | if self.button.get_label() == "Start":
47 | self.button.set_label("Stop")
48 | self.player.set_state(Gst.State.PLAYING)
49 | else:
50 | self.player.set_state(Gst.State.NULL)
51 | self.movie_window.override_background_color(0, Gdk.RGBA.from_color(Gdk.color_parse("black")))
52 | self.button.set_label("Start")
53 |
54 | def exit(self, widget, data=None):
55 | Gtk.main_quit()
56 |
57 | def on_message(self, bus, message):
58 | t = message.type
59 | if t == Gst.MessageType.EOS:
60 | self.player.set_state(Gst.State.NULL)
61 | self.button.set_label("Start")
62 | elif t == Gst.MessageType.ERROR:
63 | err, debug = message.parse_error()
64 | print "Error: %s" % err, debug
65 | self.player.set_state(Gst.State.NULL)
66 | self.button.set_label("Start")
67 |
68 | def on_sync_message(self, bus, message):
69 | if message.get_structure().get_name() == 'prepare-window-handle':
70 | imagesink = message.src
71 | imagesink.set_property("force-aspect-ratio", True)
72 | Gdk.threads_enter()
73 | imagesink.set_window_handle(self.movie_window.get_property('window').get_xid())
74 | Gdk.threads_leave()
75 |
76 |
77 | GObject.threads_init()
78 | Gst.init(None)
79 | GTK_Main()
80 | Gtk.main()
81 |
--------------------------------------------------------------------------------
/Python/pygst-tutorial/original/2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Python/pygst-tutorial/original/2.pdf
--------------------------------------------------------------------------------
/Python/pygst-tutorial/original/3.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Python/pygst-tutorial/original/3.pdf
--------------------------------------------------------------------------------
/Python/pygst-tutorial/original/4.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Python/pygst-tutorial/original/4.pdf
--------------------------------------------------------------------------------
/Python/pygst-tutorial/original/5.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Python/pygst-tutorial/original/5.pdf
--------------------------------------------------------------------------------
/Python/pygst-tutorial/original/6.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Python/pygst-tutorial/original/6.pdf
--------------------------------------------------------------------------------
/Python/pygst-tutorial/original/7.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Python/pygst-tutorial/original/7.pdf
--------------------------------------------------------------------------------
/Python/pygst-tutorial/original/8.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Python/pygst-tutorial/original/8.pdf
--------------------------------------------------------------------------------
/Python/pygst-tutorial/tvlogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubenrua/GstreamerCodeSnippets/f164eac29a6117bf647c9f888d95aa7910d305f6/Python/pygst-tutorial/tvlogo.png
--------------------------------------------------------------------------------
/Rust/basic-tutorial/1-hello-world/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 | Cargo.lock
3 |
--------------------------------------------------------------------------------
/Rust/basic-tutorial/1-hello-world/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "gstreamer-tutorial-1-hello-world"
3 | version = "0.1.0"
4 | authors = ["rubenrua "]
5 |
6 | [dependencies.gstreamer]
7 | git = "https://github.com/luisbg/gstreamer1.0-rs.git"
8 | branch = "rustfest"
9 |
--------------------------------------------------------------------------------
/Rust/basic-tutorial/1-hello-world/README.md:
--------------------------------------------------------------------------------
1 | GStreamer ❤ Rust
2 | =================
3 |
4 | **WARNING** Rust examples are experiments. Not valid for production.
5 |
6 | See:
7 |
8 | * PPT: https://coaxion.net/~slomo/talks/rustfest-2017/RustFest2017.pdf
9 | * SRC: https://github.com/luisbg/gstreamer1.0-rs/blob/rustfest/examples/video_source.rs
10 |
--------------------------------------------------------------------------------
/Rust/basic-tutorial/1-hello-world/src/main.rs:
--------------------------------------------------------------------------------
1 | extern crate gst;
2 |
3 | fn main() {
4 | println!("Hello, world!");
5 |
6 |
7 | gst::init();
8 |
9 | let mut pipeline = gst::Pipeline::new("pipe").unwrap();
10 | let videosrc = gst::Element::new("autovideosrc", "src").unwrap();
11 | let videosink = gst::Element::new("autovideosink", "sink").unwrap();
12 |
13 | if !pipeline.add_and_link(videosrc, videosink) {
14 | panic!("couldn't link videosrc and videosink");
15 | }
16 |
17 | let bus_receiver = pipeline.bus().unwrap().receiver();
18 |
19 | let mut mainloop = gst::MainLoop::new();
20 | mainloop.spawn();
21 | pipeline.play();
22 | for message in bus_receiver.iter() {
23 | match message.parse() {
24 | gst::Message::Error(_) => {
25 | println!("Error");
26 | break;
27 | }
28 | _ => {}
29 | }
30 | }
31 |
32 | mainloop.quit();
33 | }
34 |
--------------------------------------------------------------------------------
/Shell/videoeffects.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # edgetv: EdgeTV effect
4 | gst-launch-1.0 v4l2src ! videoconvert ! edgetv ! videoconvert ! autovideosink
5 |
6 | # agingtv: AgingTV effect
7 | gst-launch-1.0 v4l2src ! videoconvert ! agingtv ! videoconvert ! autovideosink
8 |
9 | # dicetv: DiceTV effect
10 | gst-launch-1.0 v4l2src ! videoconvert ! dicetv ! videoconvert ! autovideosink
11 |
12 | # warptv: WarpTV effect
13 | gst-launch-1.0 v4l2src ! videoconvert ! warptv ! videoconvert ! autovideosink
14 |
15 | # shagadelictv: ShagadelicTV
16 | gst-launch-1.0 v4l2src ! videoconvert ! shagadelictv ! videoconvert ! autovideosink
17 |
18 | # vertigotv: VertigoTV effect
19 | gst-launch-1.0 v4l2src ! videoconvert ! vertigotv ! videoconvert ! autovideosink
20 |
21 | # revtv: RevTV effect
22 | gst-launch-1.0 v4l2src ! videoconvert ! revtv ! videoconvert ! autovideosink
23 |
24 | # quarktv: QuarkTV effect
25 | gst-launch-1.0 v4l2src ! videoconvert ! quarktv ! videoconvert ! autovideosink
26 |
27 | # optv: OpTV effect
28 | gst-launch-1.0 v4l2src ! videoconvert ! optv ! videoconvert ! autovideosink
29 |
30 | # radioactv: RadioacTV effect
31 | gst-launch-1.0 v4l2src ! videoconvert ! radioactv ! videoconvert ! autovideosink
32 |
33 | # streaktv: StreakTV effect
34 | gst-launch-1.0 v4l2src ! videoconvert ! streaktv ! videoconvert ! autovideosink
35 |
36 | # rippletv: RippleTV effect
37 | gst-launch-1.0 v4l2src ! videoconvert ! rippletv ! videoconvert ! autovideosink
38 |
39 |
--------------------------------------------------------------------------------