1/*
2* Copyright (c) 2009-2011 Intel Corporation.  All rights reserved.
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 express or implied.
13* See the License for the specific language governing permissions and
14* limitations under the License.
15*/
16
17#ifndef __VIDEO_ENCODER__MPEG4_H__
18#define __VIDEO_ENCODER__MPEG4_H__
19
20#include "VideoEncoderBase.h"
21
22/**
23  * MPEG-4:2 Encoder class, derived from VideoEncoderBase
24  */
25class VideoEncoderMP4: public VideoEncoderBase {
26public:
27    VideoEncoderMP4();
28    virtual ~VideoEncoderMP4() {};
29
30//    Encode_Status getOutput(VideoEncOutputBuffer *outBuffer);
31
32protected:
33    virtual Encode_Status sendEncodeCommand(EncodeTask *task);
34    virtual Encode_Status derivedSetParams(VideoParamConfigSet *) {
35        return ENCODE_SUCCESS;
36    }
37    virtual Encode_Status derivedGetParams(VideoParamConfigSet *) {
38        return ENCODE_SUCCESS;
39    }
40    virtual Encode_Status derivedGetConfig(VideoParamConfigSet *) {
41        return ENCODE_SUCCESS;
42    }
43    virtual Encode_Status derivedSetConfig(VideoParamConfigSet *) {
44        return ENCODE_SUCCESS;
45    }
46    virtual Encode_Status getExtFormatOutput(VideoEncOutputBuffer *outBuffer);
47    //virtual Encode_Status updateFrameInfo(EncodeTask* task);
48
49    // Local Methods
50private:
51    Encode_Status getHeaderPos(uint8_t *inBuffer, uint32_t bufSize, uint32_t *headerSize);
52    Encode_Status outputConfigData(VideoEncOutputBuffer *outBuffer);
53    Encode_Status renderSequenceParams(EncodeTask *task);
54    Encode_Status renderPictureParams(EncodeTask *task);
55    Encode_Status renderSliceParams(EncodeTask *task);
56
57    unsigned char mProfileLevelIndication;
58    uint32_t mFixedVOPTimeIncrement;
59};
60
61#endif /* __VIDEO_ENCODER__MPEG4_H__ */
62