OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // MFT H.264 decode engine. | 5 // MFT H.264 decode engine. |
6 | 6 |
7 #ifndef MEDIA_VIDEO_MFT_H264_DECODE_ENGINE_H_ | 7 #ifndef MEDIA_VIDEO_MFT_H264_DECODE_ENGINE_H_ |
8 #define MEDIA_VIDEO_MFT_H264_DECODE_ENGINE_H_ | 8 #define MEDIA_VIDEO_MFT_H264_DECODE_ENGINE_H_ |
9 | 9 |
10 // TODO(imcheng): Get rid of this header by: | 10 // TODO(imcheng): Get rid of this header by: |
11 // - forward declaring IMFTransform and its IID as in | 11 // - forward declaring IMFTransform and its IID as in |
12 // mft_h264_decode_engine_context.h | 12 // mft_h264_decode_engine_context.h |
13 // - turning the general SendMFTMessage method into specific methods | 13 // - turning the general SendMFTMessage method into specific methods |
14 // (SendFlushMessage, SendDrainMessage, etc.) to avoid having | 14 // (SendFlushMessage, SendDrainMessage, etc.) to avoid having |
15 // MFT_MESSAGE_TYPE in here | 15 // MFT_MESSAGE_TYPE in here |
16 #include <mfidl.h> | 16 #include <mfidl.h> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "base/gtest_prod_util.h" | 19 #include "base/gtest_prod_util.h" |
20 #include "base/scoped_comptr_win.h" | 20 #include "base/win/scoped_comptr.h" |
21 #include "media/video/video_decode_engine.h" | 21 #include "media/video/video_decode_engine.h" |
22 | 22 |
23 struct IDirect3DSurface9; | 23 struct IDirect3DSurface9; |
24 extern "C" const GUID IID_IDirect3DSurface9; | 24 extern "C" const GUID IID_IDirect3DSurface9; |
25 | 25 |
26 class MessageLoop; | 26 class MessageLoop; |
27 | 27 |
28 namespace media { | 28 namespace media { |
29 | 29 |
30 class VideoDecodeContext; | 30 class VideoDecodeContext; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void AllocFramesFromContext(); | 70 void AllocFramesFromContext(); |
71 bool CheckDecodeEngineDxvaSupport(); | 71 bool CheckDecodeEngineDxvaSupport(); |
72 bool SetDecodeEngineMediaTypes(); | 72 bool SetDecodeEngineMediaTypes(); |
73 bool SetDecodeEngineInputMediaType(); | 73 bool SetDecodeEngineInputMediaType(); |
74 bool SetDecodeEngineOutputMediaType(const GUID subtype); | 74 bool SetDecodeEngineOutputMediaType(const GUID subtype); |
75 bool SendMFTMessage(MFT_MESSAGE_TYPE msg); | 75 bool SendMFTMessage(MFT_MESSAGE_TYPE msg); |
76 bool GetStreamsInfoAndBufferReqs(); | 76 bool GetStreamsInfoAndBufferReqs(); |
77 bool DoDecode(const PipelineStatistics& statistics); | 77 bool DoDecode(const PipelineStatistics& statistics); |
78 void OnAllocFramesDone(); | 78 void OnAllocFramesDone(); |
79 void OnUploadVideoFrameDone( | 79 void OnUploadVideoFrameDone( |
80 ScopedComPtr<IDirect3DSurface9, &IID_IDirect3DSurface9> surface, | 80 base::win::ScopedComPtr<IDirect3DSurface9, |
| 81 &IID_IDirect3DSurface9> surface, |
81 scoped_refptr<media::VideoFrame> frame, PipelineStatistics statistics); | 82 scoped_refptr<media::VideoFrame> frame, PipelineStatistics statistics); |
82 | 83 |
83 bool use_dxva_; | 84 bool use_dxva_; |
84 ScopedComPtr<IMFTransform> decode_engine_; | 85 base::win::ScopedComPtr<IMFTransform> decode_engine_; |
85 | 86 |
86 MFT_INPUT_STREAM_INFO input_stream_info_; | 87 MFT_INPUT_STREAM_INFO input_stream_info_; |
87 MFT_OUTPUT_STREAM_INFO output_stream_info_; | 88 MFT_OUTPUT_STREAM_INFO output_stream_info_; |
88 | 89 |
89 State state_; | 90 State state_; |
90 | 91 |
91 int width_; | 92 int width_; |
92 int height_; | 93 int height_; |
93 | 94 |
94 VideoDecodeEngine::EventHandler* event_handler_; | 95 VideoDecodeEngine::EventHandler* event_handler_; |
95 VideoCodecInfo info_; | 96 VideoCodecInfo info_; |
96 | 97 |
97 VideoDecodeContext* context_; | 98 VideoDecodeContext* context_; |
98 std::vector<scoped_refptr<VideoFrame> > output_frames_; | 99 std::vector<scoped_refptr<VideoFrame> > output_frames_; |
99 | 100 |
100 DISALLOW_COPY_AND_ASSIGN(MftH264DecodeEngine); | 101 DISALLOW_COPY_AND_ASSIGN(MftH264DecodeEngine); |
101 }; | 102 }; |
102 | 103 |
103 } // namespace media | 104 } // namespace media |
104 | 105 |
105 #endif // MEDIA_VIDEO_MFT_H264_DECODE_ENGINE_H_ | 106 #endif // MEDIA_VIDEO_MFT_H264_DECODE_ENGINE_H_ |
OLD | NEW |