Home | History | Annotate | Download | only in include
      1 /* ------------------------------------------------------------------
      2  * Copyright (C) 1998-2009 PacketVideo
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
     13  * express or implied.
     14  * See the License for the specific language governing permissions
     15  * and limitations under the License.
     16  * -------------------------------------------------------------------
     17  */
     18 /**
     19  * @file pvmp4ffcn_clipconfig.h
     20  * @brief Clip level configuration of PVMp4FFComposerNode
     21  */
     22 
     23 #ifndef PVMP4FFCN_CLIPCONFIG_H_INCLUDED
     24 #define PVMP4FFCN_CLIPCONFIG_H_INCLUDED
     25 
     26 #ifndef OSCL_BASE_H_INCLUDED
     27 #include "oscl_base.h"
     28 #endif
     29 #ifndef OSCL_STRING_H_INCLUDED
     30 #include "oscl_string.h"
     31 #endif
     32 #ifndef OSCL_FILE_IO_H_INCLUDED
     33 #include "oscl_file_io.h"
     34 #endif
     35 #ifndef PVMF_RETURN_CODES_H_INCLUDED
     36 #include "pvmf_return_codes.h"
     37 #endif
     38 #ifndef PV_UUID_H_INCLUDED
     39 #include "pv_uuid.h"
     40 #endif
     41 #ifndef PV_INTERFACE_H_INCLUDED
     42 #include "pv_interface.h"
     43 #endif
     44 #ifndef PV_MP4FFCOMPOSER_CONFIG_H_INCLUDED
     45 #include "pv_mp4ffcomposer_config.h"
     46 #endif
     47 
     48 
     49 #ifndef PVMI_KVP_H_INCLUDED
     50 #include "pvmi_kvp.h"
     51 #endif
     52 #define KPVMp4FFCNClipConfigUuid PVUuid(0x2e3b479f,0x2c46,0x465c,0xba,0x41,0xb8,0x91,0x11,0xa9,0xdf,0x3a)
     53 
     54 typedef enum
     55 {
     56 
     57     /**
     58      * This mode authors 3GPP Progressive Downloadable output files:
     59      * Meta Data is upfront.
     60      * Media Data is interleaved. Temp files are used.
     61      * Temporary files are written to the same directory as the output file.
     62      */
     63     PVMP4FFCN_3GPP_PROGRESSIVE_DOWNLOAD_MODE = 0x00000003,
     64 
     65     /**
     66      * This mode authors 3GPP Downloadable output files:
     67      * Meta Data is towards the end of the clip.
     68      * Media Data is interleaved.
     69      * No temp files are used.
     70      */
     71     PVMP4FFCN_3GPP_DOWNLOAD_MODE = 0x00000009,
     72 
     73 
     74     /**
     75      * This mode authors I-Motion compliant output files:
     76      * Meta Data is upfront.
     77      * Media Data is interleaved. Temp files are used.
     78      * Imotion DRM and Udta atoms are authored
     79      * Temporary files are written to the same directory as the output file.
     80      */
     81     PVMP4FFCN_IMOTION_PSEUDO_STREAMING_MODE = 0x00000007,
     82 
     83     /**
     84      * This mode authors I-Motion compliant output files:
     85      * Meta Data is towards the end of the file.
     86      * Media Data is interleaved.
     87      * Imotion DRM and Udta atoms are authored
     88      * NoTemp files are used.
     89      */
     90     PVMP4FFCN_IMOTION_DOWNLOAD_MODE = 0x0000000D,
     91 
     92     /**
     93      * This mode authors movie fragment files:
     94      * Meta Data is towards the end of the clip in MOOV and MOOF.
     95      * Media Data is interleaved.
     96      * No temp files are used.
     97      */
     98     PVMP4FFCN_MOVIE_FRAGMENT_MODE = 0x00000021
     99 
    100 
    101 } PVMp4FFCN_AuthoringMode;
    102 
    103 /**
    104  * PVMp4FFCNClipConfigInterface allows a client to control properties of PVMp4FFComposerNode
    105  */
    106 class PVMp4FFCNClipConfigInterface : public PVInterface
    107 {
    108     public:
    109         /**
    110          * Register a reference to this interface.
    111          */
    112         virtual void addRef() = 0;
    113 
    114         /**
    115          * Remove a reference to this interface.
    116          */
    117         virtual void removeRef() = 0;
    118 
    119         /**
    120          * Query for an instance of a particular interface.
    121          *
    122          * @param uuid Uuid of the requested interface
    123          * @param iface Output parameter where pointer to an instance of the
    124          * requested interface will be stored if it is supported by this object
    125          * @return true if the requested interface is supported, else false
    126          */
    127         virtual bool queryInterface(const PVUuid& uuid, PVInterface*& iface) = 0;
    128 
    129         /**
    130          * This method sets the output file name. This method must be called before
    131          * Start() is called.
    132          *
    133          * @param aFileName Output file name
    134          * @return Completion status of this method.
    135          */
    136         virtual PVMFStatus SetOutputFileName(const OSCL_wString& aFileName) = 0;
    137 
    138         /**
    139          * This method sets the output file handle. This method must be called before
    140          * Start() is called.
    141          *
    142          * @param aFileHandle Output file descriptor
    143          * @return Completion status of this method.
    144          */
    145         virtual PVMFStatus SetOutputFileDescriptor(const OsclFileHandle* aFileHandle) = 0;
    146 
    147         /**
    148          * This method sets the authoring mode. This method must be called before
    149          * Start() is called.  Default authoring mode is non 3GPPProgressive
    150          * Downloadable file using no temp files durating authoring.
    151          *
    152          * @param aAuthoringMode Authoring mode.
    153          * @return Completion status of this method.
    154          */
    155         virtual PVMFStatus SetAuthoringMode(PVMp4FFCN_AuthoringMode aAuthoringMode = PVMP4FFCN_3GPP_DOWNLOAD_MODE) = 0;
    156 
    157         /**
    158          * Method to set the sample rate (i.e. timescale) for the overall Mpeg-4 presentation.
    159          * This is an optional configuration API that should be called before Start() is called.
    160          *
    161          * @param aTimescale Timescale of MPEG4 presentation
    162          * @return Completion status of this method.
    163          */
    164         virtual PVMFStatus SetPresentationTimescale(uint32 aTimescale) = 0;
    165 
    166         /**
    167          * This method populates the version string. Version string contains
    168          * information about the version of the author SDK/app that is authoring
    169          * the clip. Currently only wide char strings are supported.
    170          */
    171         /* This is an optional configuration API that should be called before Start() is called.
    172          *
    173          * @param aVersion   version string.
    174          * @param aLangCode  OSCL_HeapString ISO-639-2/T Language code
    175          * @return Completion status of this method.
    176          */
    177         virtual PVMFStatus SetVersion(const OSCL_wString& aVersion, const OSCL_String& aLangCode) = 0;
    178 
    179         /**
    180          * This method populates the title string. Title string contains
    181          * the title of the authored clip.Currently only wide char strings are supported.
    182          */
    183 
    184 
    185         /* This is an optional configuration API that should be called before Start() is called.
    186          *
    187          * @param aTitle   title string.
    188          * @param aLangCode OSCL_HeapString ISO-639-2/T Language code
    189          * @return Completion status of this method.
    190          */
    191         virtual PVMFStatus SetTitle(const OSCL_wString& aTitle, const OSCL_String& aLangCode) = 0;
    192 
    193         /**
    194          * This method populates the author string. Title string information about
    195          * the the author of the clip (actual user - like authored by grandma martha).
    196          * Currently only wide char strings are supported.
    197          */
    198         /* This is an optional configuration API that should be called before Start() is called.
    199          *
    200          * @param aAuthor   author string.
    201          * @param aLangCode  OSCL_HeapString ISO-639-2/T Language code
    202          * @return Completion status of this method.
    203          */
    204         virtual PVMFStatus SetAuthor(const OSCL_wString& aAuthor, const OSCL_String& aLangCode) = 0;
    205 
    206 
    207         /**
    208          * This method populates the copyright string. We do not support the
    209          * authoring of ISO defined copyright atom yet. This info is used to populate
    210          * the PV proprietary user data atom.
    211          */
    212 
    213         /* This is an optional configuration API that should be called before Start() is called.
    214          *
    215          * @param aCopyright   Copyright string.
    216          * @param aLangCode  OSCL_HeapString ISO-639-2/T Language code
    217          * @return Completion status of this method.
    218          */
    219         virtual PVMFStatus SetCopyright(const OSCL_wString& aCopyright, const OSCL_String& aLangCode) = 0;
    220 
    221         /**
    222          * This method populates the description string. Description string contains
    223          * some brief description of the clip (viz. surfing on the beach). Currently only
    224          * wide char strings are supported.
    225          */
    226 
    227         /* This is an optional configuration API that should be called before Start() is called.
    228          *
    229          * @param aDescription   Description string.
    230          * @param aLangCode  OSCL_HeapString ISO-639-2/T Language code
    231          * @return Completion status of this method.
    232          */
    233         virtual PVMFStatus SetDescription(const OSCL_wString& aDescription, const OSCL_String& aLangCode) = 0;
    234 
    235         /**
    236          * This method populates the rating string. Rating string contains
    237          * some information about the clip rating (viz.PG-13). Currently only
    238          * wide char strings are supported.
    239          */
    240         /* This is an optional configuration API that should be called before Start() is called.
    241          *
    242          * @param aRating   Rating string.
    243          * @param aLangCode  OSCL_HeapString ISO-639-2/T Language code
    244          * @return Completion status of this method.
    245          */
    246         virtual PVMFStatus SetRating(const OSCL_wString& aRating, const OSCL_String& aLangCode) = 0;
    247 
    248         /**
    249          * This method ests the creation date in ISO 8601 format
    250          *
    251          * This is an optional configuration API that should be called before Start() is called.
    252          *
    253          * @param aCreationDate Creation date in ISO 8601 format.
    254          * @return Completion status of this method.
    255          */
    256         virtual PVMFStatus SetCreationDate(const OSCL_wString& aCreationDate) = 0;
    257 
    258         /**
    259          * This method sets the real time authoring mode where incoming timestamps
    260          * are adjusted when authoring starts and checks are done to ensure that
    261          * incremental timstamps do not have 0 or negative deltas. By default, this
    262          * authoring mode is disabled.
    263          *
    264          * This is an optional configuration API that should be called before Start() is called.
    265          *
    266          * @param aRealTime  Use real time authoring or not.
    267          * @return Completion status of this method.
    268          */
    269         virtual PVMFStatus SetRealTimeAuthoring(const bool aRealTime) = 0;
    270         /* This is an optional configuration API that should be called before Start() is called.
    271          *
    272          * @param aAlbum_Title   Album string.
    273          * @param aLangCode  OSCL_HeapString ISO-639-2/T Language code
    274          * @return Completion status of this method.
    275          */
    276         virtual PVMFStatus SetAlbumInfo(const OSCL_wString& aAlbum_Title, const OSCL_String& aLangCode) = 0;
    277         /* This is an optional configuration API that should be called before Start() is called.
    278          *
    279          * @param aRecordingYear   Recoding year.
    280          * @return Completion status of this method.
    281          */
    282         virtual PVMFStatus SetRecordingYear(uint16 aRecordingYear) = 0;
    283         /**
    284          * This method populates the performer string. Performer string contains information about
    285          * the the performer of the clip.
    286          * Currently only wide char strings are supported.
    287          * Language code is currently used only in case of IMOTION authoring mode,
    288          * to populate the IMOTION author info atom.
    289          *
    290          * This is an optional configuration API that should be called before Start() is called.
    291          *
    292          * @param aPerformer  performer string.
    293          * @param aLangCode  OSCL_HeapString ISO-639-2/T Language code
    294          * @return Completion status of this method.
    295          */
    296         virtual PVMFStatus SetPerformer(const OSCL_wString& aPerformer, const OSCL_String& aLangCode) = 0;
    297 
    298         /**
    299          * This method populates the genre string. Genre string contains information about
    300          * the the genre of the clip.
    301          * Currently only wide char strings are supported.
    302          * Language code is currently used only in case of IMOTION authoring mode,
    303          * to populate the IMOTION author info atom.
    304          *
    305          * This is an optional configuration API that should be called before Start() is called.
    306          *
    307          * @param aGenre  genre string.
    308          * @param aLangCode  OSCL_HeapString ISO-639-2/T Language code
    309          * @return Completion status of this method.
    310          */
    311         virtual PVMFStatus SetGenre(const OSCL_wString& aGenre, const OSCL_String& aLangCode) = 0;
    312 
    313         /**
    314          * This method populates the Classification string. classification string contains information about
    315          * the the classification of the clip .
    316          * Currently only wide char strings are supported.
    317          * Language code is currently used only in case of IMOTION authoring mode,
    318          * to populate the IMOTION author info atom.
    319          *
    320          * This is an optional configuration API that should be called before Start() is called.
    321          *
    322          * @param aClassificationInfo   classification information string.
    323          * @param aClassificationEntity classification Entity string.
    324          * @param aClassificationTable  classification Table string.
    325          * @param aLangCode  OSCL_HeapString ISO-639-2/T Language code
    326          * @return Completion status of this method.
    327          */
    328         virtual PVMFStatus SetClassification(const OSCL_wString& aClassificationInfo, uint32 aClassificationEntity, uint16 aClassificationTable, const OSCL_String& aLangCode) = 0;
    329         /**
    330          * This method populates the keyword string. keyword string contains information about
    331          * the the keyword of the clip.
    332          * Currently only wide char strings are supported.
    333          * Language code is currently used only in case of IMOTION authoring mode,
    334          * to populate the IMOTION author info atom.
    335          *
    336          * This is an optional configuration API that should be called before Start() is called.
    337          *
    338          * @param aKeyWordInfo  Keyword information string.
    339          * @param aLangCode  OSCL_HeapString ISO-639-2/T Language code
    340          * @return Completion status of this method.
    341          */
    342         virtual PVMFStatus SetKeyWord(const OSCL_wString& aKeyWordInfo, const OSCL_String& aLangCode) = 0;
    343         /**
    344          * This method populates the LocationInfo string. LocationInfo string contains information about
    345          * the the Location of the clip.
    346          *
    347          * This is an optional configuration API that should be called before Start() is called.
    348          *
    349          * @param aLocation_info  Instance of class PvmfAssetInfo3GPPLocationStruct
    350          * @return Completion status of this method.
    351          */
    352         virtual PVMFStatus SetLocationInfo(PvmfAssetInfo3GPPLocationStruct& aLocation_info) = 0;
    353         /**
    354         * This method pouplates the aLang string. aLang contains the language code as a heap string and
    355         * this function is used to convert the lang code into uint16 format and stores the lang code into
    356         * the authored media file.
    357         * @param aLang Language code in Heap String format,
    358         * @return lang_code in a uint16 format.
    359         */
    360         virtual uint16 ConvertLangCode(const OSCL_String& aLang) = 0;
    361 };
    362 
    363 #endif // PVMP4FFCN_CLIPCONFIG_H_INCLUDED
    364 
    365 
    366