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 pvmf_media_cmd.h 20 * @brief This file defines the PV Multimedia Framework (PVMF) media command 21 * class which is used for in-band control/command messages sent over the 22 * normal media data path. This class is a special case of the PVMFMediaMsg. 23 * 24 */ 25 26 #ifndef PVMF_MEDIA_CMD_H_INCLUDED 27 #define PVMF_MEDIA_CMD_H_INCLUDED 28 29 30 /* include needed for PVMFMediaMsg definition */ 31 #ifndef PVMF_MEDIA_MSG_H_INCLUDED 32 #include "pvmf_media_msg.h" 33 #endif 34 35 struct PVMFMediaMsgHeader; 36 37 class PVMFMediaCmd : public PVMFMediaMsg 38 { 39 public: PVMFMediaCmd()40 PVMFMediaCmd() : hdr_ptr(NULL) {}; 41 42 OSCL_IMPORT_REF virtual ~PVMFMediaCmd(); 43 44 OSCL_IMPORT_REF virtual PVMFTimestamp getTimestamp(); 45 OSCL_IMPORT_REF virtual uint32 getDuration(); 46 OSCL_IMPORT_REF virtual uint32 getStreamID(); 47 OSCL_IMPORT_REF virtual uint32 getSeqNum(); 48 OSCL_IMPORT_REF virtual PVUid32 getFormatID(); 49 OSCL_IMPORT_REF virtual bool queryInterface(const PVUuid& uuid, PVInterface*& iface); 50 OSCL_IMPORT_REF virtual bool getFormatSpecificInfo(OsclRefCounterMemFrag& memfrag); 51 OSCL_IMPORT_REF virtual void setTimestamp(const PVMFTimestamp& timestamp); 52 OSCL_IMPORT_REF virtual void setDuration(const uint32& duration); 53 OSCL_IMPORT_REF virtual void setStreamID(uint32 id); 54 OSCL_IMPORT_REF virtual void setSeqNum(uint32 seqnum); 55 56 /* Not from PVMFMediaMsg interface */ 57 OSCL_IMPORT_REF virtual void setFormatSpecificInfo(OsclRefCounterMemFrag& memfrag); 58 OSCL_IMPORT_REF virtual void setFormatID(PVUid32 id); 59 60 OSCL_IMPORT_REF static OsclSharedPtr<PVMFMediaCmd> 61 createMediaCmd(Oscl_DefAlloc* gen_alloc = NULL); 62 63 OSCL_IMPORT_REF static OsclSharedPtr<PVMFMediaCmd> 64 createMediaCmd(const PVMFMediaMsgHeader* msgHeader, 65 Oscl_DefAlloc* gen_alloc = NULL); 66 67 private: 68 PVMFMediaMsgHeader* hdr_ptr; 69 }; 70 71 typedef OsclSharedPtr<PVMFMediaCmd> PVMFSharedMediaCmdPtr; 72 73 OSCL_IMPORT_REF void convertToPVMFMediaCmdMsg(PVMFSharedMediaMsgPtr& dest, 74 PVMFSharedMediaCmdPtr& source); 75 OSCL_IMPORT_REF void convertToPVMFMediaCmd(PVMFSharedMediaCmdPtr& dest, 76 PVMFSharedMediaMsgPtr& source); 77 78 #endif 79