Documentation
Debug
デバッグ出力例:
全てのデバッグ出力を有効にする。出力量が膨大になるのでファイルにリダイレクトするとよい。
- --gst-debug=oggdemux:5
- --gst-debug=GST_AUTOPLUG:5,avidemux:3
- --gst-debug=GST_PIPELINE:5
環境変数によってデバッグ機能を有効にすることも可能である。
export GST_DEBUG=GST_PIPELINE:5
gdbでデバッグするためにはソースからコンパイルする必要がある。
configureはデフォルトでデバッグシンボル、デバッグシステムがenableになっているので
オプションには何も指定しないくてもよい。
./configure
Configuration
Version : 0.10.28
Source code location : .
Prefix : /usr/local
Compiler : gcc
Package name : GStreamer source release
Package origin : Unknown package origin
Documentation (manuals) : no
Documentation (API) : no
Debug Logging : yes
Pipeline XML load/save : yes
Command-line parser : yes
Option parsing in gst_init : yes
Tracing subsystem : yes
Allocation tracing : yes
Plugin registry : yes
Plugin support : yes
Network support : yes
Unit testing support : yes
Debug : yes
Profiling : no
Building examples : yes
Building test apps : yes
Building tests that fail : no
なお、gst-plugins-base、gst-plugins-goodのコンフィギュアオプションも同様である。
プラグインのビルドは依存パッケージが多いのでコンフィギュアの結果、ビルドしない
ものが多々でてくる。その場合はconfig.logからエラーを探し、依存パッケージを
インストールする。
ex: xvimagesink
# config.log
configure:25663: checking for XvQueryExtension in -lXv
configure:25688: gcc -o conftest -g -O2 conftest.c -lXv -lSM -lICE -lX11 -lXext >&5
/usr/bin/ld: cannot find -lXv
collect2: ld returned 1 exit status
...
configure:25697: result: no
configure:25738: *** These plugins will not be built: xvimagesink
# install
sudo apt-get install libxv-dev
この作業が面倒ならapt-getで依存パッケージを一括インストールしてもよい。
sudo apt-get build-dep gstreamer0.10-plugins-base
sudo apt-get build-dep gstreamer0.10-plugins-good
Test
Sample movie
Execution method
print pipeline
パイプラインの汎用的なデバッグ出力方法は次の通りである。
1. GST_PARENTAGE:5のデバッグ情報を出力する
2. デバッグ情報にbinへのエレメント追加/削除関数を対象としたgrepをかける
秀丸 grep string
(gst_bin_((add)|(remove))_func)|(Pipeline is PREROLLED)
Case A) gst-launch videotestsrc ! ximagesink
grep result
... GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<pipeline0>[00m added element "videotestsrc0"
... GST_PARENTAGE gstbin.c:1021:gst_bin_add_func:<pipeline0>[00m element "ximagesink0" was sink
... GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<pipeline0>[00m added element "ximagesink0"
Pipeline is PREROLLED ...
... GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<pipeline0>[00m removed child "ximagesink0"
... GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<pipeline0>[00m removed child "videotestsrc0"
pipeline0 : videotestsrc0 -> ximagesink0
GST_PARENTAGE gstbin.c:1021:gst_bin_add_func:<playbin0>[00m element "test" was sink
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<playbin0>[00m added element "test"
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<playbin0>[00m added element "source"
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<GstDecodeBin@0x811a080>[00m added element "typefind"
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<GstDecodeBin@0x811a080>[00m added element "fakesink"
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<playbin0>[00m added element "decodebin0"
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<decodebin0>[00m added element "qtdemux0"
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<decodebin0>[00m added element "queue0"
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<decodebin0>[00m added element "jpegdec0"
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<playbin0>[00m added element "selector_video_src0"
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<playbin0>[00m added element "preroll_video_src0"
GST_PARENTAGE gstbin.c:1021:gst_bin_add_func:<GstAutoVideoSink@0x811df08>[00m element "tempsink" was sink
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<GstAutoVideoSink@0x811df08>[00m added element "tempsink"
GST_PARENTAGE gstbin.c:1021:gst_bin_add_func:<vbin>[00m element "videosink" was sink
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<vbin>[00m added element "videosink"
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<vbin>[00m added element "vconv"
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<vbin>[00m added element "vscale"
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<vbin>[00m added element "id"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<videosink>[00m removed child "tempsink"
GST_PARENTAGE gstbin.c:1021:gst_bin_add_func:<videosink>[00m element "videosink-actual-sink-ximage" was sink
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<videosink>[00m added element "videosink-actual-sink-ximage"
GST_PARENTAGE gstbin.c:1021:gst_bin_add_func:<playbin0>[00m element "vbin" was sink
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<playbin0>[00m added element "vbin"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<playbin0>[00m removed child "test"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<decodebin0>[00m removed child "fakesink"
Pipeline is PREROLLED ...
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<playbin0>[00m added element "fakesrc0"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<decodebin0>[00m removed child "jpegdec0"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<decodebin0>[00m removed child "queue0"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<decodebin0>[00m removed child "qtdemux0"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<playbin0>[00m removed child "decodebin0"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<playbin0>[00m removed child "fakesrc0"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<playbin0>[00m removed child "preroll_video_src0"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<playbin0>[00m removed child "selector_video_src0"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<playbin0>[00m removed child "source"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<videosink>[00m removed child "videosink-actual-sink-ximage"
GST_PARENTAGE gstbin.c:1021:gst_bin_add_func:<videosink>[00m element "tempsink" was sink
GST_PARENTAGE gstbin.c:1096:gst_bin_add_func:<videosink>[00m added element "tempsink"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<playbin0>[00m removed child "vbin"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<decodebin0>[00m removed child "typefind"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<vbin>[00m removed child "id"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<vbin>[00m removed child "vscale"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<vbin>[00m removed child "vconv"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<vbin>[00m removed child "videosink"
GST_PARENTAGE gstbin.c:1371:gst_bin_remove_func:<videosink>[00m removed child "tempsink"
playbin0: source -> decodebin0 -> selector_video_src0 -> preroll_video_src0 -> vbin
decodebin0: typefind -> qtdemux0 -> queue0 -> jpegdec0
vbin: videosink -> vconv -> vscale -> id
videosink: videosink-actual-sink-ximage
Core
GstBin
GstBuffer
GstPipeline
GstPlugin
Core Library
GstBaseSrc
GstBaseSink
GstPushSrc
Plugin
Imaginary element
Plugin |
Description |
Signal call |
fakesrc |
an imaginary source |
_get() |
fakesink |
an imaginary sink |
_chain() |
identity |
an imaginary filter |
_chain() |
特徴
- これらの仮想エレメントは"handoff" シグナルを提供している
- このシグナルはfakesrcは_get()、identityとfakesink の場合は_chain()関数からコールされる
- g_signal_connectを使用してコールバック関数を登録する
- ex: g_signal_connect (fakesrc, "handoff", G_CALLBACK (cb_handoff), NULL);
Source Hierarchy
Statical View
Dynamic View
gst-launch filesrc location=sample.jpg ! jpegdec ! ffmpegcolorspace ! ximagesink
gst-launch filesrc location=mov_jpeg_aac.mov ! qtdemux ! jpegdec ! ffmpegcolorspace ! ximagesink
Note
ToDo
- ffmpegcolorspace追加
- StaticalViewのGstBin修正
- qtdemuxなどのパッド情報記述
- バッファ管理方法 プール
- GstEditor
最終更新:2011年09月03日 19:50