OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef MEDIA_CAST_VIDEO_RECEIVER_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_CAST_RECEIVER_VIDEO_DECODER_H_ |
6 #define MEDIA_CAST_VIDEO_RECEIVER_VIDEO_DECODER_H_ | 6 #define MEDIA_CAST_RECEIVER_VIDEO_DECODER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "media/base/video_frame.h" | 11 #include "media/base/video_frame.h" |
12 #include "media/cast/cast_config.h" | 12 #include "media/cast/cast_config.h" |
13 #include "media/cast/transport/cast_transport_config.h" | 13 #include "media/cast/transport/cast_transport_config.h" |
14 | 14 |
15 namespace media { | 15 namespace media { |
16 namespace cast { | 16 namespace cast { |
17 | 17 |
18 class CastEnvironment; | 18 class CastEnvironment; |
19 | 19 |
20 class VideoDecoder { | 20 class VideoDecoder { |
21 public: | 21 public: |
22 // Callback passed to DecodeFrame, to deliver a decoded video frame from the | 22 // Callback passed to DecodeFrame, to deliver a decoded video frame from the |
23 // decoder. |frame| can be NULL when errors occur. |is_continuous| is | 23 // decoder. |frame| can be NULL when errors occur. |is_continuous| is |
24 // normally true, but will be false if the decoder has detected a frame skip | 24 // normally true, but will be false if the decoder has detected a frame skip |
25 // since the last decode operation; and the client might choose to take steps | 25 // since the last decode operation; and the client might choose to take steps |
26 // to smooth/interpolate video discontinuities in this case. | 26 // to smooth/interpolate video discontinuities in this case. |
27 typedef base::Callback<void(const scoped_refptr<VideoFrame>& frame, | 27 typedef base::Callback<void(const scoped_refptr<VideoFrame>& frame, |
28 bool is_continuous)> DecodeFrameCallback; | 28 bool is_continuous)> DecodeFrameCallback; |
29 | 29 |
30 VideoDecoder(const scoped_refptr<CastEnvironment>& cast_environment, | 30 VideoDecoder(const scoped_refptr<CastEnvironment>& cast_environment, |
31 const FrameReceiverConfig& video_config); | 31 transport::VideoCodec codec); |
32 virtual ~VideoDecoder(); | 32 virtual ~VideoDecoder(); |
33 | 33 |
34 // Returns STATUS_VIDEO_INITIALIZED if the decoder was successfully | 34 // Returns STATUS_VIDEO_INITIALIZED if the decoder was successfully |
35 // constructed from the given FrameReceiverConfig. If this method returns any | 35 // constructed from the given FrameReceiverConfig. If this method returns any |
36 // other value, calls to DecodeFrame() will not succeed. | 36 // other value, calls to DecodeFrame() will not succeed. |
37 CastInitializationStatus InitializationResult() const; | 37 CastInitializationStatus InitializationResult() const; |
38 | 38 |
39 // Decode the payload in |encoded_frame| asynchronously. |callback| will be | 39 // Decode the payload in |encoded_frame| asynchronously. |callback| will be |
40 // invoked on the CastEnvironment::MAIN thread with the result. | 40 // invoked on the CastEnvironment::MAIN thread with the result. |
41 // | 41 // |
(...skipping 11 matching lines...) Expand all Loading... |
53 | 53 |
54 const scoped_refptr<CastEnvironment> cast_environment_; | 54 const scoped_refptr<CastEnvironment> cast_environment_; |
55 scoped_refptr<ImplBase> impl_; | 55 scoped_refptr<ImplBase> impl_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); | 57 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); |
58 }; | 58 }; |
59 | 59 |
60 } // namespace cast | 60 } // namespace cast |
61 } // namespace media | 61 } // namespace media |
62 | 62 |
63 #endif // MEDIA_CAST_VIDEO_RECEIVER_VIDEO_DECODER_H_ | 63 #endif // MEDIA_CAST_RECEIVER_VIDEO_DECODER_H_ |
OLD | NEW |