[FFmpeg-soc] [soc]: r3676 - mxf/mxfenc.c
spyfeng
subversion at mplayerhq.hu
Sat Aug 30 04:11:25 CEST 2008
Author: spyfeng
Date: Sat Aug 30 04:11:25 2008
New Revision: 3676
Log:
modify typo, cosmetics, and case to consistent with FFmpeg trunk
Modified:
mxf/mxfenc.c
Modified: mxf/mxfenc.c
==============================================================================
--- mxf/mxfenc.c (original)
+++ mxf/mxfenc.c Sat Aug 30 04:11:25 2008
@@ -32,7 +32,6 @@
//#define DEBUG
#include "mxf.h"
-#include <wchar.h>
typedef struct {
int local_tag;
@@ -113,7 +112,7 @@ static const MXFLocalTagPair mxf_local_t
{ 0x4701, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x02,0x03,0x00,0x00}}, /* Descriptor */
// Track
{ 0x4801, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x01,0x07,0x01,0x01,0x00,0x00,0x00,0x00}}, /* Track ID */
- { 0x4804, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x01,0x04,0x01,0x03,0x00,0x00,0x00,0x00}}, /* Track Number */
+ { 0x4804, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x01,0x03,0x00,0x00}}, /* Track Number */
{ 0x4B01, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x30,0x04,0x05,0x00,0x00,0x00,0x00}}, /* Edit Rate */
{ 0x4B02, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x03,0x01,0x03,0x00,0x00}}, /* Origin */
{ 0x4803, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x02,0x04,0x00,0x00}}, /* Sequence reference */
@@ -125,21 +124,21 @@ static const MXFLocalTagPair mxf_local_t
{ 0x1201, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x07,0x02,0x01,0x03,0x01,0x0A,0x00,0x00}}, /* Start position */
{ 0x1101, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x03,0x01,0x00,0x00,0x00}}, /* SourcePackageID */
{ 0x1102, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x03,0x02,0x00,0x00,0x00}}, /* SourceTrackID */
- // file descriptor
- { 0x3F01, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x06,0x01,0x01,0x04,0x06,0x0B,0x00,0x00}}, /* sub descriptor uid*/
+ // File Descriptor
+ { 0x3F01, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x06,0x01,0x01,0x04,0x06,0x0B,0x00,0x00}}, /* Sub Descriptors reference array */
{ 0x3006, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x06,0x01,0x01,0x03,0x05,0x00,0x00,0x00}}, /* Linked Track ID */
{ 0x3001, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x06,0x01,0x01,0x00,0x00,0x00,0x00}}, /* SampleRate */
- { 0x3004, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x01,0x02,0x00,0x00}}, /* essence container ul */
- // generic picture eseence descriptor
- { 0x3203, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x02,0x02,0x00,0x00,0x00}}, /* stored width */
- { 0x3202, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x02,0x01,0x00,0x00,0x00}}, /* stored heigth */
- { 0x320E, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x01,0x01,0x01,0x00,0x00,0x00}}, /* aspect ratio*/
- { 0x3201, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x06,0x01,0x00,0x00,0x00,0x00}}, /* picture essence coding*/
- // generic sound essence descriptor
- { 0x3D03, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x03,0x01,0x01,0x01,0x00,0x00}}, /* audio sampling rate */
- { 0x3D07, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x01,0x01,0x04,0x00,0x00,0x00}}, /* channel count */
- { 0x3D01, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x04,0x02,0x03,0x03,0x04,0x00,0x00,0x00}}, /* quantization bits */
- { 0x3D06, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x06,0x01,0x00,0x00,0x00,0x00}}, /* sound essence compression */
+ { 0x3004, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x01,0x02,0x00,0x00}}, /* Essence Container */
+ // Generic Picture Essence Descriptor
+ { 0x3203, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x02,0x02,0x00,0x00,0x00}}, /* Stored Width */
+ { 0x3202, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x02,0x01,0x00,0x00,0x00}}, /* Stored Height */
+ { 0x320E, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x01,0x01,0x01,0x00,0x00,0x00}}, /* Aspect Ratio */
+ { 0x3201, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x06,0x01,0x00,0x00,0x00,0x00}}, /* Picture Essence Coding */
+ // Generic Sound Essence Descriptor
+ { 0x3D03, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x03,0x01,0x01,0x01,0x00,0x00}}, /* Audio sampling rate */
+ { 0x3D07, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x01,0x01,0x04,0x00,0x00,0x00}}, /* ChannelCount */
+ { 0x3D01, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x04,0x02,0x03,0x03,0x04,0x00,0x00,0x00}}, /* Quantization bits */
+ { 0x3D06, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x06,0x01,0x00,0x00,0x00,0x00}}, /* Sound Essence Compression */
};
static void mxf_write_uuid(ByteIOContext *pb, enum CodecID type, int value)
@@ -325,19 +324,6 @@ static void mxf_write_preface(AVFormatCo
put_be64(pb, 0);
}
-
-static void mxf_write_utf16string(ByteIOContext *pb, const char *value)
-{
- // only support ASCII type of value[i]
- int i, size = strlen(value);
- for (i = 0; i < size; i++)
- {
- put_byte(pb, 0);
- put_byte(pb, value[i]);
- }
- put_be16(pb, 0);
-}
-
static void mxf_write_identification(AVFormatContext *s)
{
ByteIOContext *pb = s->pb;
@@ -345,16 +331,14 @@ static void mxf_write_identification(AVF
mxf_write_metadata_key(pb, 0x013000);
PRINT_KEY(s, "identification key", pb->buf_ptr - 16);
- company_name_len = sizeof("FFmpeg") * 2;
- product_name_len = sizeof("OP1a Muxer") * 2;
+ company_name_len = sizeof("FFmpeg");
+ product_name_len = sizeof("OP1a Muxer");
length = 80 + company_name_len + product_name_len;
- if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT))
- version_string_len = sizeof(AV_STRINGIFY(LIBAVFORMAT_VERSION)) * 2;
- else
- version_string_len = sizeof("0.0.0") * 2;
-
- length += 4 + version_string_len;
+ if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
+ version_string_len = sizeof(LIBAVFORMAT_IDENT);
+ length += 4 + version_string_len;
+ }
klv_encode_ber_length(pb, length);
// write uid
@@ -366,16 +350,15 @@ static void mxf_write_identification(AVF
mxf_write_uuid(pb, Identification, 1);
mxf_write_local_tag(pb, company_name_len, 0x3C01);
- mxf_write_utf16string(pb, "FFmpeg");
+ put_buffer(pb, "FFmpeg", company_name_len);
mxf_write_local_tag(pb, product_name_len, 0x3C02);
- mxf_write_utf16string(pb, "OP1a Muxer");
+ put_buffer(pb, "OP1a Muxer", product_name_len);
- mxf_write_local_tag(pb, version_string_len, 0x3C04);
- if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT))
- mxf_write_utf16string(pb, AV_STRINGIFY(LIBAVFORMAT_VERSION));
- else
- mxf_write_utf16string(pb, "0.0.0");
+ if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
+ mxf_write_local_tag(pb, version_string_len, 0x3C04);
+ put_buffer(pb, LIBAVFORMAT_IDENT, version_string_len);
+ }
// write product uid
mxf_write_local_tag(pb, 16, 0x3C05);
More information about the FFmpeg-soc
mailing list