[gst-devel] how to package media data into fakesrc

ma.xiaobo at zte.com.cn ma.xiaobo at zte.com.cn
Tue May 23 04:18:06 CEST 2006


my application is just like the following,but nothing display ,what's 
wrong with my application. would you please give me
one suggestion,thanks a lot

0.gst_init
1. create the pipeline
2. call gst_element_factory_make to create the fakesrc, mpeg2decoder, 
mpeg2sink
3. call gst_bus_add_watch
4. call gst_bin_add_many and gst_element_link_many
5. call g_object_set( G_OBJECT(fakesrc),
                "signal-handoffs",TRUE,
                "sizemax",1316,
                "sizetype",2,
                NULL);
6. call g_signal_connect(fakesrc,"handoff",G_CALLBACK(cb_handoff),NULL);

7. read the mpeg2 file and store the media data into one buffer

8.  for(i = 0; i < num; i ++)                    //num is the number of 
the file buffer num = filesize/1316 
   {
    memcpy(GST_BUFFER_DATA(gbuf), ptr, 1316);    //gbuf is the pointer 
that point to fakesrc buffer 
                                                 //ptr is the pointer that 
point to the file data
    g_printf("222222222\n");
    ptr += 1316;
    sleep(3);
    g_main_iteration(TRUE);
  }





--------------------------------------------------------
ZTE Information Security Notice: The information contained in this mail is solely property of the sender's organization. This mail communication is confidential. Recipients named above are obligated to maintain secrecy and are not permitted to disclose the contents of this communication to others.
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the originator of the message. Any views expressed in this message are those of the individual sender.
This message has been scanned for viruses and Spam by ZTE Anti-Spam system.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20060523/b2cc7541/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 33033 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20060523/b2cc7541/attachment.gif>


More information about the gstreamer-devel mailing list