*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("application/x-rtp, "
"media = (string) \"video\", "
- "payload = (int) " GST_RTP_PAYLOAD_DYNAMIC_STRING ", "
"clock-rate = (int) 90000, " "encoding-name = (string) \"RAW\"")
);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_vraw_depay_sink_template));
- gst_element_class_set_details_simple (gstelement_class,
+ gst_element_class_set_static_metadata (gstelement_class,
"RTP Raw Video depayloader", "Codec/Depayloader/Network/RTP",
"Extracts raw video from RTP packets (RFC 4175)",
"Wim Taymans <wim.taymans@gmail.com>");
static void
gst_rtp_vraw_depay_init (GstRtpVRawDepay * rtpvrawdepay)
{
- /* needed because of GST_BOILERPLATE */
}
static void
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, size, min, max);
- if (gst_query_has_allocation_meta (query, GST_VIDEO_META_API_TYPE)) {
+ if (gst_query_find_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL)) {
/* just set the metadata, if the pool can support it we will transparently use
* it through the video info API. We could also see if the pool support this
* metadata and only activate it then. */
GstRtpVRawDepay *rtpvrawdepay;
gint clock_rate;
const gchar *str;
- gint format, width, height, pgroup, xinc, yinc;
+ gint format, width, height, depth, pgroup, xinc, yinc;
GstCaps *srccaps;
gboolean res;
GstFlowReturn ret;
goto no_height;
height = atoi (str);
+ if (!(str = gst_structure_get_string (structure, "depth")))
+ goto no_depth;
+ depth = atoi (str);
+
/* optional interlace value but we don't handle interlaced
* formats yet */
if (gst_structure_get_string (structure, "interlace"))
format = GST_VIDEO_FORMAT_AYUV;
pgroup = 3;
} else if (!strcmp (str, "YCbCr-4:2:2")) {
- format = GST_VIDEO_FORMAT_UYVY;
- pgroup = 4;
+ if (depth == 8) {
+ format = GST_VIDEO_FORMAT_UYVY;
+ pgroup = 4;
+ } else if (depth == 10) {
+ format = GST_VIDEO_FORMAT_UYVP;
+ pgroup = 5;
+ } else
+ goto unknown_format;
xinc = 2;
} else if (!strcmp (str, "YCbCr-4:2:0")) {
format = GST_VIDEO_FORMAT_I420;
xinc, yinc, pgroup);
/* negotiate a bufferpool */
- if ((ret = gst_rtp_vraw_depay_negotiate_pool (rtpvrawdepay, caps,
+ if ((ret = gst_rtp_vraw_depay_negotiate_pool (rtpvrawdepay, srccaps,
&rtpvrawdepay->vinfo)) != GST_FLOW_OK)
goto no_bufferpool;
GST_ERROR_OBJECT (depayload, "no height specified");
return FALSE;
}
+no_depth:
+ {
+ GST_ERROR_OBJECT (depayload, "no depth specified");
+ return FALSE;
+ }
interlaced:
{
GST_ERROR_OBJECT (depayload, "interlaced formats not supported yet");
gint width, height, xinc, yinc;
GstRTPBuffer rtp = { NULL };
GstVideoFrame frame;
+ gboolean marker;
+ GstBuffer *outbuf = NULL;
rtpvrawdepay = GST_RTP_VRAW_DEPAY (depayload);
case GST_VIDEO_FORMAT_BGR:
case GST_VIDEO_FORMAT_BGRA:
case GST_VIDEO_FORMAT_UYVY:
+ case GST_VIDEO_FORMAT_UYVP:
/* samples are packed just like gstreamer packs them */
offs /= xinc;
datap = yp + (line * ystride) + (offs * pgroup);
}
gst_video_frame_unmap (&frame);
+ marker = gst_rtp_buffer_get_marker (&rtp);
gst_rtp_buffer_unmap (&rtp);
- if (gst_rtp_buffer_get_marker (&rtp)) {
+ if (marker) {
GST_LOG_OBJECT (depayload, "marker, flushing frame");
- if (rtpvrawdepay->outbuf) {
- gst_rtp_base_depayload_push (depayload, rtpvrawdepay->outbuf);
- rtpvrawdepay->outbuf = NULL;
- }
+ outbuf = rtpvrawdepay->outbuf;
+ rtpvrawdepay->outbuf = NULL;
rtpvrawdepay->timestamp = -1;
}
- return NULL;
+ return outbuf;
/* ERRORS */
unknown_sampling: