os/mm/mmplugins/lib3gp/impl/inc/mp4compose.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef _MP4COMPOSE_H
sl@0
    17
#define _MP4COMPOSE_H
sl@0
    18
sl@0
    19
sl@0
    20
#include <3gplibrary/mp4config.h>
sl@0
    21
#include "mp4atom.h"
sl@0
    22
sl@0
    23
sl@0
    24
#define MVHD_TIMESCALE  10000
sl@0
    25
sl@0
    26
#define METADATA_COPY_BUFFERSIZE  8192   /* Must be divisible by 4 */
sl@0
    27
sl@0
    28
sl@0
    29
typedef struct trakSize
sl@0
    30
{
sl@0
    31
  mp4_u32    trak;
sl@0
    32
  mp4_u32    tkhd;
sl@0
    33
  mp4_u32    mdia;
sl@0
    34
  mp4_u32    mdhd;
sl@0
    35
  mp4_u32    hdlr;
sl@0
    36
  mp4_u32    minf;
sl@0
    37
  mp4_u32    vmhd;
sl@0
    38
  mp4_u32    smhd;
sl@0
    39
  mp4_u32    dinf;
sl@0
    40
  mp4_u32    dref;
sl@0
    41
  mp4_u32    stbl;
sl@0
    42
  mp4_u32    stsd;
sl@0
    43
  mp4_u32    stts;
sl@0
    44
  mp4_u32    stsc;
sl@0
    45
  mp4_u32    stsz;
sl@0
    46
  mp4_u32    stco;
sl@0
    47
  mp4_u32    stss;
sl@0
    48
  mp4_u32    mp4v;
sl@0
    49
  mp4_u32    mp4a;
sl@0
    50
  mp4_u32    esds;
sl@0
    51
  mp4_u32    s263;
sl@0
    52
  mp4_u32    samr;
sl@0
    53
  mp4_u32    sawb;
sl@0
    54
  mp4_u32    d263;
sl@0
    55
  mp4_u32    damr;
sl@0
    56
  mp4_u32	 avc1;
sl@0
    57
  mp4_u32	 avcc;
sl@0
    58
  mp4_u32	 btrt;
sl@0
    59
  mp4_u32	 m4ds;
sl@0
    60
  mp4_u32    sqcp;
sl@0
    61
  mp4_u32    dqcp;
sl@0
    62
  mp4_u32    udta;
sl@0
    63
  mp4_u32    sdtp;
sl@0
    64
  mp4_u32    avcp;
sl@0
    65
} trakSize;
sl@0
    66
sl@0
    67
sl@0
    68
sl@0
    69
mp4_i32 updateVideoMetaData(MP4HandleImp handle, mp4_u32 size, mp4_u32 duration, mp4_bool keyframe);
sl@0
    70
mp4_i32 updateAudioMetaData(MP4HandleImp handle, mp4_u32 size, mp4_u32 duration);
sl@0
    71
mp4_i32 writeFTYPAndMDATToFile(MP4HandleImp handle);
sl@0
    72
mp4_i32 writeDataToFile(MP4HandleImp handle);
sl@0
    73
mp4_i32 updateDecodingTimeToSample(MP4HandleImp handle, sampleTable *st, mp4_u32 duration);
sl@0
    74
mp4_i32 updateSampleSize(MP4HandleImp handle, sampleTable *st, mp4_u32 size);
sl@0
    75
mp4_i32 updateSampleToChunk(sampleTable *st);
sl@0
    76
mp4_i32 updateChunkOffset(MP4HandleImp handle, sampleTable *st);
sl@0
    77
mp4_i32 updateSyncSample(MP4HandleImp handle, sampleTable *st);
sl@0
    78
mp4_i32 determineAudioTrakMetaDataSize(MP4HandleImp handle, sampleTable *st, trakSize *ts);
sl@0
    79
mp4_i32 determineVideoTrakMetaDataSize(MP4HandleImp handle, sampleTable *st, trakSize *ts);
sl@0
    80
mp4_i32 reUpdateAudioMetaData(sampleTable *st, mp4_u32 metaDataSize);
sl@0
    81
mp4_i32 reUpdateVideoMetaData(sampleTable *st, mp4_u32 metaDataSize);
sl@0
    82
mp4_i32 writeFTYP(MP4HandleImp handle);
sl@0
    83
mp4_i32 writeMOOV(MP4HandleImp handle, mp4_u32 moovSize, mp4_bool haveAudio, mp4_bool haveVideo, trakSize *audioTrackSize, trakSize *videoTrakSize);
sl@0
    84
mp4_i32 writeMVHD(MP4HandleImp handle);
sl@0
    85
mp4_i32 writeVideoTrak(MP4HandleImp handle, trakSize *ts);
sl@0
    86
mp4_i32 writeVideoTKHD(MP4HandleImp handle, trakSize *ts);
sl@0
    87
mp4_i32 writeVideoMDIA(MP4HandleImp handle, trakSize *ts);
sl@0
    88
mp4_i32 writeVideoMDHD(MP4HandleImp handle, trakSize *ts);
sl@0
    89
mp4_i32 writeVideoHDLR(MP4HandleImp handle, trakSize *ts);
sl@0
    90
mp4_i32 writeVideoMINF(MP4HandleImp handle, trakSize *ts);
sl@0
    91
mp4_i32 writeVMHD(MP4HandleImp handle, trakSize *ts);
sl@0
    92
mp4_i32 writeDINF(MP4HandleImp handle, trakSize *ts);
sl@0
    93
mp4_i32 writeDREF(MP4HandleImp handle, trakSize *ts);
sl@0
    94
mp4_i32 writeVideoSTBL(MP4HandleImp handle, trakSize *ts);
sl@0
    95
mp4_i32 writeVideoSTSD(MP4HandleImp handle, trakSize *ts);
sl@0
    96
mp4_i32 writeMP4V(MP4HandleImp handle, trakSize *ts);
sl@0
    97
mp4_i32 writeVideoESD(MP4HandleImp handle, trakSize *ts);
sl@0
    98
mp4_i32 writeS263(MP4HandleImp handle, trakSize *ts);
sl@0
    99
mp4_i32 writeD263(MP4HandleImp handle, trakSize *ts);
sl@0
   100
mp4_i32 writeVideoSTTS(MP4HandleImp handle, trakSize *ts);
sl@0
   101
mp4_i32 writeVideoSTTSLongClip(MP4HandleImp handle, trakSize *ts);
sl@0
   102
mp4_i32 writeVideoSTSC(MP4HandleImp handle, trakSize *ts);
sl@0
   103
mp4_i32 writeVideoSTSZ(MP4HandleImp handle, trakSize *ts);
sl@0
   104
mp4_i32 writeVideoSTSZLongClip(MP4HandleImp handle, trakSize *ts);
sl@0
   105
mp4_i32 writeVideoSTCO(MP4HandleImp handle, trakSize *ts);
sl@0
   106
mp4_i32 writeVideoCO64(MP4HandleImp handle, trakSize *ts);
sl@0
   107
mp4_i32 writeVideoSTCOLongClip(MP4HandleImp handle, trakSize *ts);
sl@0
   108
mp4_i32 writeVideoCO64LongClip(MP4HandleImp handle, trakSize *ts);
sl@0
   109
mp4_i32 writeVideoSTSS(MP4HandleImp handle, trakSize *ts);
sl@0
   110
mp4_i32 writeVideoSTSSLongClip(MP4HandleImp handle, trakSize *ts);
sl@0
   111
mp4_i32 writeAVC1(MP4HandleImp handle, trakSize *ts);
sl@0
   112
mp4_i32 writeAVCC(MP4HandleImp handle, trakSize *ts);
sl@0
   113
sl@0
   114
mp4_i32 writeAudioTrak(MP4HandleImp handle, trakSize *ts);
sl@0
   115
mp4_i32 writeAudioTKHD(MP4HandleImp handle, trakSize *ts);
sl@0
   116
mp4_i32 writeAudioMDIA(MP4HandleImp handle, trakSize *ts);
sl@0
   117
mp4_i32 writeAudioMDHD(MP4HandleImp handle, trakSize *ts);
sl@0
   118
mp4_i32 writeAudioHDLR(MP4HandleImp handle, trakSize *ts);
sl@0
   119
mp4_i32 writeAudioMINF(MP4HandleImp handle, trakSize *ts);
sl@0
   120
mp4_i32 writeSMHD(MP4HandleImp handle, trakSize *ts);
sl@0
   121
mp4_i32 writeAudioSTBL(MP4HandleImp handle, trakSize *ts);
sl@0
   122
mp4_i32 writeAudioSTSD(MP4HandleImp handle, trakSize *ts);
sl@0
   123
mp4_i32 writeMP4A(MP4HandleImp handle, trakSize *ts);
sl@0
   124
mp4_i32 writeAudioESD(MP4HandleImp handle, trakSize *ts);
sl@0
   125
mp4_i32 writeSAMR(MP4HandleImp handle, trakSize *ts);
sl@0
   126
mp4_i32 writeSAWB(MP4HandleImp handle, trakSize *ts);
sl@0
   127
mp4_i32 writeDAMR(MP4HandleImp handle, trakSize *ts);
sl@0
   128
mp4_i32 writeAudioSTTS(MP4HandleImp handle, trakSize *ts);
sl@0
   129
mp4_i32 writeAudioSTTSLongClip(MP4HandleImp handle, trakSize *ts);
sl@0
   130
mp4_i32 writeAudioSTSC(MP4HandleImp handle, trakSize *ts);
sl@0
   131
mp4_i32 writeAudioSTSZ(MP4HandleImp handle, trakSize *ts);
sl@0
   132
mp4_i32 writeAudioSTSZLongClip(MP4HandleImp handle, trakSize *ts);
sl@0
   133
mp4_i32 writeAudioSTCO(MP4HandleImp handle, trakSize *ts);
sl@0
   134
mp4_i32 writeAudioCO64(MP4HandleImp handle, trakSize *ts);
sl@0
   135
mp4_i32 writeAudioSTCOLongClip(MP4HandleImp handle, trakSize *ts);
sl@0
   136
mp4_i32 writeAudioCO64LongClip(MP4HandleImp handle, trakSize *ts);
sl@0
   137
mp4_i32 writeSQCP(MP4HandleImp handle, trakSize *ts);
sl@0
   138
mp4_i32 writeDQCP(MP4HandleImp handle, trakSize *ts);
sl@0
   139
sl@0
   140
mp4_i32 writeMediaData(MP4HandleImp handle);
sl@0
   141
sl@0
   142
mp4_i32 insertu64(mp4_u8 *buf, mp4_u64 value);
sl@0
   143
mp4_i32 insertu32(mp4_u8 *buf, mp4_u32 value);
sl@0
   144
mp4_i32 insertu16(mp4_u8 *buf, mp4_u16 value);
sl@0
   145
sl@0
   146
mp4_i32 writeMetaDataTmp(MP4HandleImp handle);
sl@0
   147
mp4_i32 calculateES_DescriptorSize(MP4HandleImp handle, mp4_u32 type);
sl@0
   148
mp4_i32 writeUDTA(MP4HandleImp handle, userDataAtom *udta);
sl@0
   149
mp4_i32 updateVideoDependencyMetaData(MP4HandleImp handle, mp4_u8 aDependsOn, mp4_u8 aIsDependentOn, mp4_u8 aHasRedundancy);
sl@0
   150
mp4_i32 writeVideoSDTP(MP4HandleImp handle, trakSize *ts);
sl@0
   151
mp4_i32 writeVideoSDTPLongClip(MP4HandleImp handle, trakSize *ts);
sl@0
   152
mp4_i32 writeAVCP(MP4HandleImp handle, trakSize *ts);
sl@0
   153
#endif
sl@0
   154
// End of File