<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello <br>
<br>
I'm trying to setup a video sink that will do some video conversion
and attach that to a playbin2 element. Here is a snippet of what I
am trying to do:<br>
<br>
gs_data->video = gst_bin_new("videobin");<br>
flt = gst_element_factory_make ("capsfilter", "flt");<br>
g_object_set (G_OBJECT (flt), "caps", gst_caps_new_simple
("video/x-raw-rgb", "red_mask", G_TYPE_INT, 65280, "green_mask",
G_TYPE_INT, 16711680, "blue_mask", G_TYPE_INT, 4278190080, "width",
G_TYPE_INT, gs_data->render_info->output_width,<br>
"height",
G_TYPE_INT,gs_data->render_info->output_height ,
"framerate", GST_TYPE_FRACTION, 24, 1, NULL), NULL);<br>
videoconv = gst_element_factory_make ("ffmpegcolorspace",
"conv");<br>
videorate = gst_element_factory_make ("videorate", "vrate");<br>
videoscale = gst_element_factory_make ("videoscale", "scaler");<br>
<br>
videosink = gst_element_factory_make ("fakesink", "sink");<br>
<br>
<br>
g_object_set (G_OBJECT (videosink), "signal-handoffs", TRUE,
NULL);<br>
g_object_set (G_OBJECT (videosink), "sync", TRUE, NULL);<br>
g_signal_connect (videosink, "handoff", G_CALLBACK (cb_handoff),
gs_data);<br>
gst_element_link_many(videoconv, videoqueue, videoscale,
videorate, flt, videosink, NULL);<br>
gst_bin_add_many(GST_BIN(gs_data->video), videoconv,
videoqueue, videoscale, videorate, flt, videosink, NULL);<br>
//<br>
videopad = gst_element_get_static_pad(videoconv, "sink");<br>
gst_element_add_pad(gs_data->video,
gst_ghost_pad_new("ghost",videopad));<br>
gst_object_unref(videopad);<br>
<br>
gs_data->pipeline = gst_element_factory_make ("playbin2",
"player");<br>
pthread_mutex_lock(&gs_data->channel_mutex);<br>
gs_data->loop = g_main_loop_new (NULL, FALSE);<br>
bus = gst_pipeline_get_bus (GST_PIPELINE
(gs_data->pipeline));<br>
<br>
gst_bus_add_watch (bus, bus_call, gs_data);<br>
gst_object_unref (bus);<br>
g_object_set(G_OBJECT(gs_data->pipeline), "uri",
gs_data->media_name, NULL);<br>
g_object_set(G_OBJECT(gs_data->pipeline), "volume",
gs_data->volume, NULL);<br>
g_object_set(G_OBJECT(gs_data->pipeline), "video-sink",
gs_data->video, NULL);<br>
<br>
<br>
The problem is that my handler for the handoff never gets called for
the fakesink, and I get a pad has no peer error on my fakesink
element. Previously, I was using a decodebin and I had to link my
ghost pad to the video pad in a new_decoded_pad handler. Do I have
to do the same sort of thing for playbin2? I was thinking that I
had to setup a handler for the video_changed signal, and in that
handler, grab the pad for the stream and then link my pad to the
video pad. Does that sound about right, or am I way out in the
weeds on this one?<br>
<br>
Thanks,<br>
Rodney<br>
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="CONTENT-TYPE" content="text/html;
charset=ISO-8859-1">
<title></title>
<meta name="GENERATOR" content="OpenOffice.org 3.2 (Unix)">
<meta name="AUTHOR" content="Rodney Dowdall">
<meta name="CREATED" content="20100531;22163400">
<meta name="CHANGEDBY" content="Rodney Dowdall">
<meta name="CHANGED" content="20100622;13310800">
<style type="text/css">
        <!--
                @page { margin: 2cm }
                P { margin-bottom: 0.21cm }
                A:link { so-language: zxx }
        -->
        </style>
<p><font color="#333333"><font face="Arial, sans-serif"><font
size="2"><b>Rodney
Dowdall</b></font></font></font><font face="Arial,
sans-serif"><font size="2"><b><br>
</b></font></font><font color="#333333"><font face="Arial,
sans-serif"><font size="2"><b>Crank
Software Inc.</b></font></font></font><font face="Arial,
sans-serif"><font size="2"><b><br>
</b></font></font><font color="#b4d023"><font face="Arial,
sans-serif"><font size="2"><span lang="en-US"><b>Office</b></span></font></font></font><font
face="Arial, sans-serif"><font size="2"><span lang="en-US">:
</span></font></font><font color="#333333"><font
face="Arial, sans-serif"><font size="2"><span lang="en-US"><b>613-595-1999</b></span></font></font></font><font
face="Arial, sans-serif"><font size="2"><span lang="en-US"><br>
</span></font></font><font color="#b4d023"><font
face="Arial, sans-serif"><font size="2"><span lang="en-US"><b>Online</b></span></font></font></font><font
face="Arial, sans-serif"><font size="2"><span lang="en-US">:
</span></font></font><a href="http://www.cranksoftware.com/"><font
color="#0000ff"><font face="Arial, sans-serif"><font
size="2"><span lang="en-US"><b>www.cranksoftware.com</b></span></font></font></font></a><font
color="#0000ff"><font face="Calibri, sans-serif"><font
size="2"><span lang="en-US"><br>
</span></font></font></font><font color="#b4d023"><font
face="Arial, sans-serif"><font size="2"><span lang="en-US"><b>Check
out</b></span></font></font></font><font face="Arial,
sans-serif"><font size="2"><span lang="en-US">:
</span></font></font><a
href="http://cranksoftware.com/blog/"><font color="#0000ff"><font
face="Arial, sans-serif"><font size="2"><span lang="en-US"><b>Crank
Software’s
Blog</b></span></font></font></font></a><font
color="#0000ff"><font face="Calibri, sans-serif"><font
size="2"><span lang="en-US"><br>
</span></font></font></font><font color="#333333"><font
face="Arial, sans-serif"><font size="2"><span lang="en-US"><b>There
is
a better way to build user interfaces for embedded
devices.<br>
Download a <a
href="http://www.cranksoftware.com/products/eval.php">30
day
evaluation</a> of Crank Storyboard Suite today!</b></span></font></font></font></p>
<p><br>
<br>
</p>
<p style="margin-bottom: 0cm;"><br>
</p>
</div>
</body>
</html>