const char* PLAYBACK =
"filesrc location=foo.avi !"
"avidemux name=demx ! ffdec_mpeg2video ! queue !"
"xvimagesink name=x11w demx. ! queue ! ffdec_mp3 ! alsasink";
const char* RECORD = "alsasrc device=plughw:1,0 ! tee name=sndsrc !"
"queue name=sndqueue max-size-buffers=100 ! audiorate !"
" audio/x-raw-int,width=8,rate=16000 ! audioconvert ! ffenc_mp2 ! "
"mx. v4lsrc typefind=true ! tee name=vidsrc ! queue name=vidqueue !"
" videorate ! video/x-raw-yuv,framerate=25/1,width=640,height=480 !"
" ffenc_mpeg2video ! avimux name=mx ! filesink location=foo.avi sndsrc. "
"! queue ! alsasink vidsrc.! queue ! xvimagesink name=x11w";
const char* VIEW = "alsasrc device=plughw:1,0 ! "
"queue name=sndqueue max-size-buffers=100 ! audiorate !"
" audio/x-raw-int,width=8,rate=16000 ! alsasink v4lsrc typefind=true"
" ! queue name=vidqueue ! videorate !"
" video/x-raw-yuv,framerate=25/1,width=640,height=480 ! "
"queue ! xvimagesink name=x11w";
//code
//code
//code
void GstFrame::create_pipeline()
{
if(pipeline) destroy_pipeline();
GError *err=0;
pipeline = gst_parse_launch(pipmode,&err);
if (err != NULL) {
/* Report error to user, and free error */
cerr << "Unable to create pipeline: " << err->message << endl;
return;
} else {
assert(pipeline!=0);
}
xvimagesink = gst_bin_get_by_name(GST_BIN(pipeline), "x11w");
gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(xvimagesink), gstframe->winId());
bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
bus_poll_timer->start(50);
pipeline_state = GST_STATE_NULL;
set_eos(false);
}
const char* PLAYBACK =
"filesrc location=foo.avi !"
"avidemux name=demx ! ffdec_mpeg2video ! queue !"
"xvimagesink name=x11w demx. ! queue ! ffdec_mp3 ! alsasink";
const char* RECORD = "alsasrc device=plughw:1,0 ! tee name=sndsrc !"
"queue name=sndqueue max-size-buffers=100 ! audiorate !"
" audio/x-raw-int,width=8,rate=16000 ! audioconvert ! ffenc_mp2 ! "
"mx. v4lsrc typefind=true ! tee name=vidsrc ! queue name=vidqueue !"
" videorate ! video/x-raw-yuv,framerate=25/1,width=640,height=480 !"
" ffenc_mpeg2video ! avimux name=mx ! filesink location=foo.avi sndsrc. "
"! queue ! alsasink vidsrc.! queue ! xvimagesink name=x11w";
const char* VIEW = "alsasrc device=plughw:1,0 ! "
"queue name=sndqueue max-size-buffers=100 ! audiorate !"
" audio/x-raw-int,width=8,rate=16000 ! alsasink v4lsrc typefind=true"
" ! queue name=vidqueue ! videorate !"
" video/x-raw-yuv,framerate=25/1,width=640,height=480 ! "
"queue ! xvimagesink name=x11w";
//code
//code
//code
void GstFrame::create_pipeline()
{
if(pipeline) destroy_pipeline();
GError *err=0;
pipeline = gst_parse_launch(pipmode,&err);
if (err != NULL) {
/* Report error to user, and free error */
cerr << "Unable to create pipeline: " << err->message << endl;
return;
} else {
assert(pipeline!=0);
}
xvimagesink = gst_bin_get_by_name(GST_BIN(pipeline), "x11w");
gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(xvimagesink), gstframe->winId());
bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
bus_poll_timer->start(50);
pipeline_state = GST_STATE_NULL;
set_eos(false);
}
To copy to clipboard, switch view to plain text mode
When I come to run this code, i get pipeline=0, and assert fails.
Bookmarks