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_DECODER_WMV_H_
18 #define VIDEO_DECODER_WMV_H_
19 
20 #include "VideoDecoderBase.h"
21 
22 
23 class VideoDecoderWMV : public VideoDecoderBase {
24 public:
25     VideoDecoderWMV(const char *mimeType);
26     virtual ~VideoDecoderWMV();
27 
28     virtual Decode_Status start(VideoConfigBuffer *buffer);
29     virtual void stop(void);
30     virtual void flush(void);
31     virtual Decode_Status decode(VideoDecodeBuffer *buffer);
32 
33 protected:
34     virtual Decode_Status checkHardwareCapability();
35 
36 
37 private:
38     Decode_Status decodeFrame(VideoDecodeBuffer *buffer, vbp_data_vc1 *data);
39     Decode_Status decodePicture(vbp_data_vc1 *data, int32_t picIndex);
40     Decode_Status setReference(VAPictureParameterBufferVC1 *params, int32_t picIndex, VASurfaceID current);
41     void updateDeblockedPicIndexes(int frameType);
42     Decode_Status updateConfigData(uint8_t *configData, int32_t configDataLen, uint8_t **newConfigData, int32_t *newConfigDataLen);
43     Decode_Status startVA(vbp_data_vc1 *data);
44     void updateFormatInfo(vbp_data_vc1 *data);
45     inline Decode_Status allocateVABufferIDs(int32_t number);
46     Decode_Status parseBuffer(uint8_t *data, int32_t size, vbp_data_vc1 **vbpData);
47 
48 private:
49     enum {
50         VC1_SURFACE_NUMBER = 10,
51         VC1_EXTRA_SURFACE_NUMBER = 3,
52     };
53 
54     VABufferID *mBufferIDs;
55     int32_t mNumBufferIDs;
56     bool mConfigDataParsed;
57     bool mRangeMapped;
58 
59     int32_t mDeblockedCurrPicIndex;
60     int32_t mDeblockedLastPicIndex;
61     int32_t mDeblockedForwardPicIndex;
62 };
63 
64 
65 
66 #endif /* VIDEO_DECODER_WMV_H_ */
67