OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file contains an implementation of a class that provides H264 decode | 5 // This file contains an implementation of a class that provides H264 decode |
6 // support for use with VAAPI hardware video decode acceleration on Intel | 6 // support for use with VAAPI hardware video decode acceleration on Intel |
7 // systems. | 7 // systems. |
8 | 8 |
9 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_H264_DECODER_H_ | 9 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_H264_DECODER_H_ |
10 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_H264_DECODER_H_ | 10 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_H264_DECODER_H_ |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // be the same as the one on which Decode*() functions are called. | 43 // be the same as the one on which Decode*() functions are called. |
44 class VaapiH264Decoder { | 44 class VaapiH264Decoder { |
45 public: | 45 public: |
46 // Callback invoked on the client when a picture is to be displayed. | 46 // Callback invoked on the client when a picture is to be displayed. |
47 // Arguments: input buffer id, output buffer id (both provided by the client | 47 // Arguments: input buffer id, output buffer id (both provided by the client |
48 // at the time of Decode() and AssignPictureBuffer() calls). | 48 // at the time of Decode() and AssignPictureBuffer() calls). |
49 typedef base::Callback<void(int32, int32)> OutputPicCB; | 49 typedef base::Callback<void(int32, int32)> OutputPicCB; |
50 | 50 |
51 // Callback invoked on the client to start a GPU job to decode and render | 51 // Callback invoked on the client to start a GPU job to decode and render |
52 // a video frame into a pixmap/texture. Callee has to call SubmitDecode() | 52 // a video frame into a pixmap/texture. Callee has to call SubmitDecode() |
53 // for the given picture, taking ownership of the queues. | 53 // for the given picture. |
54 // Arguments: output buffer id (provided by the client at the time of | 54 // Arguments: output buffer id (provided by the client at the time of |
55 // AssignPictureBuffer() call), va buffer and slice buffer queues to be | 55 // AssignPictureBuffer() call), va buffer and slice buffer queues to be |
56 // passed to SubmitDecode(). SubmitDecode() will take ownership of the | 56 // passed to SubmitDecode(). |
57 // queues. | 57 typedef base::Callback< |
58 typedef base::Callback<void(int32, | 58 void(int32, |
59 std::queue<VABufferID>*, | 59 scoped_ptr<std::queue<VABufferID> >, |
60 std::queue<VABufferID>*)> SubmitDecodeCB; | 60 scoped_ptr<std::queue<VABufferID> >)> SubmitDecodeCB; |
61 | 61 |
62 // Decode result codes. | 62 // Decode result codes. |
63 enum DecResult { | 63 enum DecResult { |
64 kDecodeError, // Error while decoding. | 64 kDecodeError, // Error while decoding. |
65 // TODO posciak: unsupported streams are currently treated as error | 65 // TODO posciak: unsupported streams are currently treated as error |
66 // in decoding; in future it could perhaps be possible to fall back | 66 // in decoding; in future it could perhaps be possible to fall back |
67 // to software decoding instead. | 67 // to software decoding instead. |
68 // kStreamError, // Error in stream. | 68 // kStreamError, // Error in stream. |
69 kReadyToDecode, // Successfully initialized. | 69 kReadyToDecode, // Successfully initialized. |
70 kDecodedFrame, // Successfully decoded a frame. | 70 kDecodedFrame, // Successfully decoded a frame. |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 | 362 |
363 // Has static initialization of pre-sandbox components completed successfully? | 363 // Has static initialization of pre-sandbox components completed successfully? |
364 static bool pre_sandbox_init_done_; | 364 static bool pre_sandbox_init_done_; |
365 | 365 |
366 DISALLOW_COPY_AND_ASSIGN(VaapiH264Decoder); | 366 DISALLOW_COPY_AND_ASSIGN(VaapiH264Decoder); |
367 }; | 367 }; |
368 | 368 |
369 } // namespace content | 369 } // namespace content |
370 | 370 |
371 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_H264_DECODER_H_ | 371 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_H264_DECODER_H_ |
OLD | NEW |