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 #ifndef MEDIA_BASE_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_BASE_VIDEO_DECODER_H_ |
6 #define MEDIA_BASE_VIDEO_DECODER_H_ | 6 #define MEDIA_BASE_VIDEO_DECODER_H_ |
7 | 7 |
| 8 #include <string> |
| 9 |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "media/base/media_export.h" | 12 #include "media/base/media_export.h" |
11 #include "media/base/pipeline_status.h" | 13 #include "media/base/pipeline_status.h" |
12 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
13 | 15 |
14 namespace media { | 16 namespace media { |
15 | 17 |
16 class DecoderBuffer; | 18 class DecoderBuffer; |
17 class VideoDecoderConfig; | 19 class VideoDecoderConfig; |
(...skipping 21 matching lines...) Expand all Loading... |
39 typedef base::Callback<void(Status status)> DecodeCB; | 41 typedef base::Callback<void(Status status)> DecodeCB; |
40 | 42 |
41 VideoDecoder(); | 43 VideoDecoder(); |
42 | 44 |
43 // Fires any pending callbacks, stops and destroys the decoder. | 45 // Fires any pending callbacks, stops and destroys the decoder. |
44 // Note: Since this is a destructor, |this| will be destroyed after this call. | 46 // Note: Since this is a destructor, |this| will be destroyed after this call. |
45 // Make sure the callbacks fired from this call doesn't post any task that | 47 // Make sure the callbacks fired from this call doesn't post any task that |
46 // depends on |this|. | 48 // depends on |this|. |
47 virtual ~VideoDecoder(); | 49 virtual ~VideoDecoder(); |
48 | 50 |
| 51 // Returns the name of the decoder for logging purpose. |
| 52 virtual std::string GetDisplayName() const = 0; |
| 53 |
49 // Initializes a VideoDecoder with the given |config|, executing the | 54 // Initializes a VideoDecoder with the given |config|, executing the |
50 // |status_cb| upon completion. |output_cb| is called for each output frame | 55 // |status_cb| upon completion. |output_cb| is called for each output frame |
51 // decoded by Decode(). | 56 // decoded by Decode(). |
52 // | 57 // |
53 // Note: | 58 // Note: |
54 // 1) The VideoDecoder will be reinitialized if it was initialized before. | 59 // 1) The VideoDecoder will be reinitialized if it was initialized before. |
55 // Upon reinitialization, all internal buffered frames will be dropped. | 60 // Upon reinitialization, all internal buffered frames will be dropped. |
56 // 2) This method should not be called during pending decode or reset. | 61 // 2) This method should not be called during pending decode or reset. |
57 // 3) No VideoDecoder calls should be made before |status_cb| is executed. | 62 // 3) No VideoDecoder calls should be made before |status_cb| is executed. |
58 virtual void Initialize(const VideoDecoderConfig& config, | 63 virtual void Initialize(const VideoDecoderConfig& config, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Returns maximum number of parallel decode requests. | 105 // Returns maximum number of parallel decode requests. |
101 virtual int GetMaxDecodeRequests() const; | 106 virtual int GetMaxDecodeRequests() const; |
102 | 107 |
103 private: | 108 private: |
104 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); | 109 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); |
105 }; | 110 }; |
106 | 111 |
107 } // namespace media | 112 } // namespace media |
108 | 113 |
109 #endif // MEDIA_BASE_VIDEO_DECODER_H_ | 114 #endif // MEDIA_BASE_VIDEO_DECODER_H_ |
OLD | NEW |