Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_PIPELINE_DEVICE_H_ | 5 #ifndef CHROMECAST_PUBLIC_MEDIA_VIDEO_PIPELINE_DEVICE_H_ |
| 6 #define CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_PIPELINE_DEVICE_H_ | 6 #define CHROMECAST_PUBLIC_MEDIA_VIDEO_PIPELINE_DEVICE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "media_component_device.h" |
| 9 #include "base/macros.h" | |
| 10 #include "chromecast/media/cma/backend/media_component_device.h" | |
| 11 | |
| 12 namespace gfx { | |
| 13 class Size; | |
| 14 } | |
| 15 | 9 |
| 16 namespace chromecast { | 10 namespace chromecast { |
| 11 struct Size; | |
| 12 | |
| 17 namespace media { | 13 namespace media { |
| 18 class DecoderBufferBase; | |
| 19 struct VideoConfig; | 14 struct VideoConfig; |
| 20 | 15 |
| 21 // VideoPipelineDevice - | 16 // VideoPipelineDevice - |
| 22 // | 17 // |
| 23 // Notes: | 18 // Notes: |
| 24 // - Like a regular MediaComponentDevice, frames are possibly rendered only | 19 // - Like a regular MediaComponentDevice, frames are possibly rendered only |
| 25 // in the kRunning state. | 20 // in the kRunning state. |
| 26 // However, the first frame must be rendered regardless of the clock state: | 21 // However, the first frame must be rendered regardless of the clock state: |
| 27 // - no synchronization needed to display the first frame, | 22 // - no synchronization needed to display the first frame, |
| 28 // - the clock rate has no impact on the presentation of the first frame. | 23 // - the clock rate has no impact on the presentation of the first frame. |
| 29 // | 24 // |
| 30 class VideoPipelineDevice : public MediaComponentDevice { | 25 class VideoPipelineDevice : public MediaComponentDevice { |
| 31 public: | 26 public: |
| 32 struct VideoClient { | 27 // Callback interface for natural size of video changing. |
| 33 VideoClient(); | 28 class VideoClient { |
| 34 ~VideoClient(); | 29 public: |
| 35 | 30 virtual ~VideoClient() {} |
| 36 // Invoked each time the natural size is updated. | 31 virtual void OnNaturalSizeChanged(const Size& size) = 0; |
| 37 base::Callback<void(const gfx::Size& natural_size)> | |
| 38 natural_size_changed_cb; | |
| 39 }; | 32 }; |
| 40 | 33 |
| 41 VideoPipelineDevice(); | 34 VideoPipelineDevice() {} |
|
byungchul
2015/07/27 18:22:23
not necessary
halliwell
2015/07/28 02:19:36
removed.
| |
| 42 ~VideoPipelineDevice() override; | 35 ~VideoPipelineDevice() override {} |
| 43 | 36 |
| 44 // Registers |client| as the video specific event handler. | 37 // Registers |client| as the video specific event handler. |
| 45 virtual void SetVideoClient(const VideoClient& client) = 0; | 38 // Implementation takes ownership of |client|. |
|
gunsch
2015/07/27 17:14:49
Is there guidance on when |client| should be delet
halliwell
2015/07/28 02:19:36
Indeed, pipeline now owns, simplifies this for OEM
byungchul
2015/07/28 18:05:43
It would be confusing for vendros if we mix the ow
halliwell
2015/07/28 23:26:06
Yeah I'm considering going back to vendor ownershi
gunsch
2015/07/29 17:04:20
I like the idea of a conformance test guaranteeing
halliwell
2015/07/29 19:58:19
Don't think it would be too hard, but would prefer
| |
| 39 virtual void SetVideoClient(VideoClient* client) = 0; | |
| 46 | 40 |
| 47 // Provide the video configuration. | 41 // Provide the video configuration. |
| 48 // Must be called before switching from |kStateUninitialized| to |kStateIdle|. | 42 // Must be called before switching from |kStateUninitialized| to |kStateIdle|. |
| 49 // Afterwards, this can be invoked any time the configuration changes. | 43 // Afterwards, this can be invoked any time the configuration changes. |
| 50 // Returns true if the configuration is a supported configuration. | 44 // Returns true if the configuration is a supported configuration. |
| 51 virtual bool SetConfig(const VideoConfig& config) = 0; | 45 virtual bool SetConfig(const VideoConfig& config) = 0; |
| 52 | |
| 53 private: | |
| 54 DISALLOW_COPY_AND_ASSIGN(VideoPipelineDevice); | |
| 55 }; | 46 }; |
| 56 | 47 |
| 57 } // namespace media | 48 } // namespace media |
| 58 } // namespace chromecast | 49 } // namespace chromecast |
| 59 | 50 |
| 60 #endif // CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_PIPELINE_DEVICE_H_ | 51 #endif // CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_PIPELINE_DEVICE_H_ |
| OLD | NEW |