CVS Root: /cvs/gstreamer
Module: gst-plugins-bad
Changes by: slomo
Date: Thu Nov 27 2008 10:10:07 UTC
Log message:
* gst/mxf/Makefile.am:
* gst/mxf/mxfdemux.c:
(gst_mxf_demux_handle_header_metadata_update_streams),
(gst_mxf_demux_handle_klv_packet):
* gst/mxf/mxfdv-dif.c: (mxf_is_dv_dif_essence_track),
(mxf_dv_dif_handle_essence_element), (mxf_dv_dif_create_caps):
* gst/mxf/mxfdv-dif.h:
* gst/mxf/mxfparse.c: (mxf_is_descriptive_metadata):
* gst/mxf/mxfparse.h:
Add fundamental support for DV-DIF essence streams.
Handle descriptive metadata packets as metadata packets.
Modified files:
. : ChangeLog
gst/mxf : Makefile.am mxfdemux.c mxfparse.c mxfparse.h
Added files:
gst/mxf : mxfdv-dif.c mxfdv-dif.h
Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.3751&r2=1.3752
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/mxf/Makefile.am.diff?r1=1.1&r2=1.2
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/mxf/mxfdemux.c.diff?r1=1.10&r2=1.11
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/mxf/mxfdv-dif.c?rev=1.1&content-type=text/vnd.viewcvs-markup
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/mxf/mxfdv-dif.h?rev=1.1&content-type=text/vnd.viewcvs-markup
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/mxf/mxfparse.c.diff?r1=1.9&r2=1.10
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/mxf/mxfparse.h.diff?r1=1.6&r2=1.7
====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v
retrieving revision 1.3751
retrieving revision 1.3752
diff -u -d -r1.3751 -r1.3752
--- ChangeLog 27 Nov 2008 08:49:06 -0000 1.3751
+++ ChangeLog 27 Nov 2008 10:09:51 -0000 1.3752
@@ -1,5 +1,20 @@
2008-11-27 Sebastian Dröge <[email protected]>
+ * gst/mxf/Makefile.am:
+ * gst/mxf/mxfdemux.c:
+ (gst_mxf_demux_handle_header_metadata_update_streams),
+ (gst_mxf_demux_handle_klv_packet):
+ * gst/mxf/mxfdv-dif.c: (mxf_is_dv_dif_essence_track),
+ (mxf_dv_dif_handle_essence_element), (mxf_dv_dif_create_caps):
+ * gst/mxf/mxfdv-dif.h:
+ * gst/mxf/mxfparse.c: (mxf_is_descriptive_metadata):
+ * gst/mxf/mxfparse.h:
+ Add fundamental support for DV-DIF essence streams.
+
+ Handle descriptive metadata packets as metadata packets.
+2008-11-27 Sebastian Dröge <[email protected]>
* gst/mxf/mxfdemux.c: (gst_mxf_demux_reset),
(gst_mxf_demux_handle_klv_packet):
* gst/mxf/mxfdemux.h:
Index: Makefile.am
RCS file: /cvs/gstreamer/gst-plugins-bad/gst/mxf/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Makefile.am 21 Nov 2008 10:27:13 -0000 1.1
+++ Makefile.am 27 Nov 2008 10:09:52 -0000 1.2
@@ -5,7 +5,8 @@
mxfdemux.c \
mxfparse.c \
mxfaes-bwf.c \
- mxfmpeg.c
+ mxfmpeg.c \
+ mxfdv-dif.c
libgstmxf_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS)
libgstmxf_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS)
@@ -16,5 +17,6 @@
mxfparse.h \
mxfaes-bwf.h \
mxfmpeg.h \
+ mxfdv-dif.h \
mxftypes.h
Index: mxfdemux.c
RCS file: /cvs/gstreamer/gst-plugins-bad/gst/mxf/mxfdemux.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- mxfdemux.c 27 Nov 2008 08:49:07 -0000 1.10
+++ mxfdemux.c 27 Nov 2008 10:09:52 -0000 1.11
@@ -33,6 +33,7 @@
#include "mxfparse.h"
#include "mxfaes-bwf.h"
#include "mxfmpeg.h"
+#include "mxfdv-dif.h"
#include <string.h>
@@ -1274,9 +1275,8 @@
MXFMetadataEssenceContainerData, i);
for (j = 0; j < demux->content_storage.n_essence_container_data; j++) {
- if (mxf_ul_is_equal (&demux->
- content_storage.essence_container_data_uids[j],
- &data->instance_uid)) {
+ if (mxf_ul_is_equal (&demux->content_storage.
+ essence_container_data_uids[j], &data->instance_uid)) {
demux->content_storage.essence_container_data[j] = data;
break;
}
@@ -1812,14 +1812,26 @@
caps =
mxf_mpeg_video_create_caps (source_package, source_track,
&pad->tags, &pad->handle_essence_element, &pad->mapping_data);
+ else if (mxf_is_dv_dif_essence_track (source_track))
+ caps =
+ mxf_dv_dif_create_caps (source_package, source_track,
+ &pad->tags, &pad->handle_essence_element, &pad->mapping_data);
break;
case MXF_METADATA_TRACK_SOUND_ESSENCE:
if (mxf_is_aes_bwf_essence_track (source_track))
mxf_aes_bwf_create_caps (source_package, source_track, &pad->tags,
&pad->handle_essence_element, &pad->mapping_data);
case MXF_METADATA_TRACK_DATA_ESSENCE:
+ if (mxf_is_dv_dif_essence_track (source_track))
default:
g_assert_not_reached ();
@@ -2391,7 +2403,7 @@
if (demux->update_metadata
&& !mxf_timestamp_is_unknown (&demux->preface.last_modified_date)
- && !mxf_is_metadata (key)
+ && !mxf_is_metadata (key) && !mxf_is_descriptive_metadata (key)
&& !mxf_is_fill (key)) {
if ((ret =
gst_mxf_demux_handle_header_metadata_resolve_references (demux)) !=
--- NEW FILE: mxfdv-dif.c ---
/* GStreamer
* Copyright (C) 2008 Sebastian Dröge <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* 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.
*/
/* Implementation of SMPTE 383M - Mapping DV-DIF data into the MXF
* Generic Container
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include <string.h>
#include "mxfdv-dif.h"
GST_DEBUG_CATEGORY_EXTERN (mxf_debug);
#define GST_CAT_DEFAULT mxf_debug
gboolean
mxf_is_dv_dif_essence_track (const MXFMetadataTrack * track)
{
guint i;
g_return_val_if_fail (track != NULL, FALSE);
if (track->descriptor == NULL)
return FALSE;
for (i = 0; i < track->n_descriptor; i++) {
MXFMetadataFileDescriptor *d = track->descriptor[i];
MXFUL *key = &d->essence_container;
/* SMPTE 383M 8 */
if (mxf_is_generic_container_essence_container_label (key) &&
key->u[12] == 0x02 && key->u[13] == 0x02)
return TRUE;
}
return FALSE;
}
static GstFlowReturn
mxf_dv_dif_handle_essence_element (const MXFUL * key, GstBuffer * buffer,
GstCaps * caps, MXFMetadataGenericPackage * package,
MXFMetadataTrack * track, MXFMetadataStructuralComponent * component,
gpointer mapping_data, GstBuffer ** outbuf)
*outbuf = buffer;
/* SMPTE 383 6.1.1 */
if (key->u[12] != 0x18 || (key->u[14] != 0x01 && key->u[14] != 0x02)) {
GST_ERROR ("Invalid DV-DIF essence element");
return GST_FLOW_ERROR;
return GST_FLOW_OK;
GstCaps *
mxf_dv_dif_create_caps (MXFMetadataGenericPackage * package,
MXFMetadataTrack * track, GstTagList ** tags,
MXFEssenceElementHandler * handler, gpointer * mapping_data)
MXFMetadataFileDescriptor *f = NULL;
GstCaps *caps = NULL;
g_return_val_if_fail (package != NULL, NULL);
g_return_val_if_fail (track != NULL, NULL);
if (track->descriptor == NULL) {
GST_ERROR ("No descriptor found for this track");
return NULL;
if (((MXFMetadataGenericDescriptor *) track->descriptor[i])->
is_file_descriptor
&& ((MXFMetadataGenericDescriptor *) track->descriptor[i])->type !=
MXF_METADATA_MULTIPLE_DESCRIPTOR) {
f = track->descriptor[i];
}
if (!f) {
*handler = mxf_dv_dif_handle_essence_element;
/* SMPTE 383M 8 */
/* TODO: might be video or audio only, use values of the generic sound/picture
* descriptor in the caps in that case
* Also dvdemux might not forward timestamps
*/
if (f->essence_container.u[13] == 0x02) {
GST_DEBUG ("Found DV-DIF stream");
caps =
gst_caps_new_simple ("video/x-dv", "systemstream", G_TYPE_BOOLEAN, TRUE,
NULL);
return caps;
--- NEW FILE: mxfdv-dif.h ---
#ifndef __MXF_DV_DIF_H__
#define __MXF_DV_DIF_H__
#include "mxfparse.h"
gboolean mxf_is_dv_dif_essence_track (const MXFMetadataTrack *track);
mxf_dv_dif_create_caps (MXFMetadataGenericPackage *package, MXFMetadataTrack *track, GstTagList **tags, MXFEssenceElementHandler *handler, gpointer *mapping_data);
#endif /* __MXF_DV_DIF_H__ */
Index: mxfparse.c
RCS file: /cvs/gstreamer/gst-plugins-bad/gst/mxf/mxfparse.c,v
retrieving revision 1.9
diff -u -d -r1.9 -r1.10
--- mxfparse.c 26 Nov 2008 11:30:28 -0000 1.9
+++ mxfparse.c 27 Nov 2008 10:09:53 -0000 1.10
@@ -141,6 +141,18 @@
return (memcmp (key, metadata_key, 13) == 0 && key->u[15] == 0x00);
}
+/* SMPTE 377M 8.7.3 */
+gboolean
+mxf_is_descriptive_metadata (const MXFUL * key)
+{
+ return (memcmp (key, mxf_key, 4) == 0 &&
+ key->u[4] == 0x02 &&
+ key->u[6] == 0x01 &&
+ key->u[7] == 0x01 &&
+ key->u[8] == 0x0d &&
+ key->u[9] == 0x01 && key->u[10] == 0x04 && key->u[11] == 0x01);
+}
gboolean
mxf_is_random_index_pack (const MXFUL * key)
{
Index: mxfparse.h
RCS file: /cvs/gstreamer/gst-plugins-bad/gst/mxf/mxfparse.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- mxfparse.h 26 Nov 2008 10:37:34 -0000 1.6
+++ mxfparse.h 27 Nov 2008 10:09:53 -0000 1.7
@@ -48,6 +48,7 @@
gboolean mxf_is_primer_pack (const MXFUL *key);
gboolean mxf_is_metadata (const MXFUL *key);
+gboolean mxf_is_descriptive_metadata (const MXFUL *key);
gboolean mxf_is_random_index_pack (const MXFUL *key);
gboolean mxf_is_index_table_segment (const MXFUL *key);
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-cvs-verbose mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs-verbose
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.