<div class="gmail_quote"><div><div class="gmail_quote"><font size="4">HI,</font><div><font size="4"><br></font></div><div>
<font size="4">I am wondering if any of u could help in any way.. :)</font></div><div><font size="4"><br></font></div><div><font size="4">I am currently working on a Intelce4100 based settop box and happen to use ismd_vidrend_sink. My application is such that video should be played in a particular Directfb rectangle. I am using ismd_vidrend_sink and with the property "rectangle". I could get the video playing in the gdl-plane but not in the desired directfb rectangle. I am a newbie to ismd and wonder if i am doing things right here...</font></div>
<div><font size="4"><br></font></div><div><font size="4">Below is a overview of my code:</font></div><div><font size="4"><br></font></div><div><div><font size="4">static void</font></div><div><font size="4">dfb_update(player_stream_t *player_stream)</font></div>
<div><font size="4">{</font></div><div><font size="4"> if (! player_stream)</font></div><div><font size="4"> {</font></div><div><font size="4"> return;</font></div><div><font size="4"> }</font></div>
<div><font size="4"><br></font></div><div><font size="4"> if (player_stream->fVideoSink && player_stream->fIsPlaying)</font></div><div><font size="4"> {</font></div><div><font size="4"> /* That's the interesting part, giving the dfb video surface to dfbvideosink */</font></div>
<div><font size="4"> printf("dfb Update ###########Co ordinates for Rectangle : %s\n",rectangle_desc);</font></div><div><font size="4"> g_object_set(peer_player_stream->fVideoSink,"rectangle",rectangle_desc, NULL);</font></div>
<div><font size="4"> }</font></div><div><font size="4">}</font></div></div><div><font size="4"><br></font></div><div><div><font size="4">static slim_int</font></div><div><font size="4">dfb_initialize (player_stream_t *player_stream)</font></div>
<div><font size="4">{</font></div><div><font size="4"> slim_int iResult = SLIM_E_OK;</font></div><div><font size="4"><br></font></div><div><font size="4"> /* ------------------------------------------------</font></div>
<div><font size="4"> * DirectFB Surface Initialization for media player</font></div><div><font size="4"> * ------------------------------------------------</font></div><div><font size="4"> */</font></div>
<div><font size="4"> if (! player_stream || ! player_stream->fPeerPlayer)</font></div><div><font size="4"> {</font></div><div><font size="4"> return SLIM_E_GENERIC;</font></div><div><font size="4"> }</font></div>
<div><font size="4"><br></font></div><div><font size="4"> /* Restrict video area to rectangle*/</font></div><div><font size="4"> rect.x = player_stream->fPeerPlayer->fDisplayParam.xpos;</font></div><div>
<font size="4"> rect.y = player_stream->fPeerPlayer->fDisplayParam.ypos;</font></div><div><font size="4"> rect.w = player_stream->fPeerPlayer->fDisplayParam.width;</font></div><div><font size="4"> rect.h = player_stream->fPeerPlayer->fDisplayParam.height;</font></div>
<div><font size="4"><br></font></div><div><font size="4"> rectangle_desc=g_strdup_printf("%d,%d,%d,%d",rect.x,rect.y,rect.w,rect.h);</font></div><div><font size="4"> printf("dfb Initialize ###########Co ordinates for Rectangle : %s\n",rectangle_desc);</font></div>
<div><font size="4"><br></font></div><div><font size="4"> </font></div><div><font size="4"> /*</font></div><div><font size="4"> * GetSubsurface from primary surface and restrict it to the rectangle. Instead of using</font></div>
<div><font size="4"> * the surface created for the gst-player we directly get the subsurface of the primary</font></div><div><font size="4"> * surface created by dfb by which we can avoid extra operations</font></div>
<div><font size="4"> * */</font></div><div><font size="4"> <font color="#ff0000"> g_object_set(peer_player_stream->fVideoSink, "rectangle",rectangle_desc, NULL); // This seems to me the problem as it always gives GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed. </font><span style="color:rgb(255,0,0)"> </span></font></div>
<div><font size="4"> gWavePeerPrimary->GetSubSurface( gWavePeerPrimary, &rect, &peer_player_stream->fVideoSink);</font></div><div><font size="4"> peer_player_dfb_update(peer_player_stream);</font></div>
<div><font size="4"> /* Cleanup underlying Surface */</font></div><div><font size="4"> DFBCHECK(gWavePeerPrimary->Clear(gWavePeerPrimary, 0, 0, 0, 0x80));</font></div><div><font size="4"> return iResult;</font></div>
<div><font size="4">}</font></div><div><font size="4"><br></font></div><div><font size="4">static void</font></div><div><font size="4">peer_player_gst_init(peer_player_stream_t *peer_player_stream)</font></div><div><font size="4">{</font></div>
</div><div><div><font size="4">GstBus *bus = NULL;</font></div><div><font size="4"> GstPad* pad;</font></div><div><font size="4"> DFBCHECK (DirectFBInit (NULL, NULL));</font></div><div><font size="4"> gst_init (NULL, NULL);</font></div>
<div><font size="4"><br></font></div><div><font size="4"> /* Create the bin and its elements */</font></div><div><font size="4"> peer_player_stream->fVideoSink = gst_element_factory_make ("ismd_vidrend_bin", "ismd_videosink");</font></div>
<div><font size="4"><br></font></div><div><font size="4"> bus = gst_pipeline_get_bus (GST_PIPELINE (peer_player_stream->fPlay));</font></div><div><font size="4"> gst_bus_add_watch (bus, peer_player_gst_bus_callback, peer_player_stream);</font></div>
<div><font size="4"> gst_object_unref (bus);</font></div><div><font size="4"><br></font></div><div><font size="4"> gst_bin_add(GST_BIN(peer_player_stream->fBin), peer_player_stream->fVideoSink);</font></div>
<div><font size="4"><br></font></div><div><font size="4"> /* Create the ghost pad and let the it point to bin's first element's sink */</font></div><div><font size="4"> pad = gst_element_get_static_pad(peer_player_stream->fVideoSink, "sink");</font></div>
<div><font size="4"> gst_element_add_pad(peer_player_stream->fBin, gst_ghost_pad_new("sink", pad));</font></div><div><font size="4"> gst_object_unref(GST_OBJECT (pad));</font></div><div><font size="4">}</font></div>
<div><font size="4"><br></font></div><div><font size="4">static void</font></div><div><font size="4">peer_player_gst_prepare_to_play(peer_player_stream_t *peer_player_stream)</font></div><div><font size="4">{</font></div>
<div><font size="4"> slim_int gst_flags;</font></div><div><font size="4"><br></font></div><div><font size="4"> </font></div><div><font size="4"> g_object_get (G_OBJECT (peer_player_stream->fPlay), "flags", &gst_flags, NULL);</font></div>
</div><div><div><font size="4"> g_object_set (G_OBJECT (peer_player_stream->fPlay), "flags", gst_flags, NULL);</font></div><div><font size="4"> g_object_set (G_OBJECT (peer_player_stream->fPlay), "buffer-size", 1024*1024, NULL);</font></div>
<div><font size="4"> g_object_set (G_OBJECT (peer_player_stream->fPlay), "uri", peer_player_stream->fUri, NULL);</font></div><div><font size="4"><br></font></div><div><font size="4"> g_object_set(peer_player_stream->fVideoSink,"rectangle",rectangle_desc,NULL);</font></div>
<div><font size="4"> g_object_set(peer_player_stream->fVideoSink,"gdl-plane","UPPC",NULL);</font></div><div><font size="4"><br></font></div><div><font size="4"> /* Set the video surface to dfbvideosink property "surface" */</font></div>
<div><font size="4"> peer_player_dfb_update(peer_player_stream);</font></div><div><font size="4"><br></font></div><div><font size="4"> peer_player_set_event(peer_player_stream);</font></div><div><font size="4"><br>
</font></div><div><font size="4"> g_play = peer_player_stream->fPlay;</font></div><div><font size="4"><br></font></div><div><font size="4"> if(g_play) {</font></div><div><font size="4"> if(g_mute) {</font></div>
<div><font size="4"> g_object_set(G_OBJECT(g_play), "volume", 0.0, NULL);</font></div><div><font size="4"> }</font></div><div><font size="4"> else {</font></div>
<div><font size="4"> g_object_set(G_OBJECT(g_play), "volume", g_vol, NULL);</font></div><div><font size="4"> }</font></div><div><font size="4"> }</font></div><div><font size="4"><br>
</font></div><div><font size="4"> peer_player_stream->fSpeed = NORMAL_SPEED;</font></div><div><font size="4"><br></font></div><div><font size="4"> if (gst_element_set_state(peer_player_stream->fPlay, GST_STATE_READY) == GST_STATE_CHANGE_FAILURE) {</font></div>
<div><font size="4"> printf("peer_player_gst_prepare_to_play() - Error: Pipeline Is Not Ready\n");</font></div><div><div><font size="4"> else</font></div><div><font size="4"> {</font></div>
<div><font size="4"> /* TODO Normally the autovideo sink would create an own output window, so we set GstXOverlay for outputting video to browser window. */</font></div><div><font size="4"> g_object_set (G_OBJECT (peer_player_stream->fPlay), "video-sink", peer_player_stream->fBin , NULL);</font></div>
<div><font size="4"><br></font></div><div><font size="4"> }</font></div><div><font size="4"><br></font></div><div><font size="4">}</font></div></div><div><font size="4"><br></font></div><div><font size="4"><br></font></div>
<div><font size="4"><br></font></div><div><font size="4"> I am just stuck here and going no where....</font></div><div><font size="4"><br></font></div><div><font size="4">thanks in advance</font></div>
<div><font size="4"><br></font></div><div><font size="4">Regards,</font></div><div><font size="4">Sudhir .</font></div><div><font size="4"> </font></div>
</div><div><br></div>
</div><br></div>
</div><br>