| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_PIPELINE_DEVICE_H_ | |
| 6 #define CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_PIPELINE_DEVICE_H_ | |
| 7 | |
| 8 #include "base/callback.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 | |
| 16 namespace chromecast { | |
| 17 namespace media { | |
| 18 class DecoderBufferBase; | |
| 19 struct VideoConfig; | |
| 20 | |
| 21 // VideoPipelineDevice - | |
| 22 // | |
| 23 // Notes: | |
| 24 // - Like a regular MediaComponentDevice, frames are possibly rendered only | |
| 25 // in the kRunning state. | |
| 26 // However, the first frame must be rendered regardless of the clock state: | |
| 27 // - no synchronization needed to display the first frame, | |
| 28 // - the clock rate has no impact on the presentation of the first frame. | |
| 29 // | |
| 30 class VideoPipelineDevice : public MediaComponentDevice { | |
| 31 public: | |
| 32 struct VideoClient { | |
| 33 VideoClient(); | |
| 34 ~VideoClient(); | |
| 35 | |
| 36 // Invoked each time the natural size is updated. | |
| 37 base::Callback<void(const gfx::Size& natural_size)> | |
| 38 natural_size_changed_cb; | |
| 39 }; | |
| 40 | |
| 41 VideoPipelineDevice(); | |
| 42 ~VideoPipelineDevice() override; | |
| 43 | |
| 44 // Registers |client| as the video specific event handler. | |
| 45 virtual void SetVideoClient(const VideoClient& client) = 0; | |
| 46 | |
| 47 // Provide the video configuration. | |
| 48 // Must be called before switching from |kStateUninitialized| to |kStateIdle|. | |
| 49 // Afterwards, this can be invoked any time the configuration changes. | |
| 50 // Returns true if the configuration is a supported configuration. | |
| 51 virtual bool SetConfig(const VideoConfig& config) = 0; | |
| 52 | |
| 53 private: | |
| 54 DISALLOW_COPY_AND_ASSIGN(VideoPipelineDevice); | |
| 55 }; | |
| 56 | |
| 57 } // namespace media | |
| 58 } // namespace chromecast | |
| 59 | |
| 60 #endif // CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_PIPELINE_DEVICE_H_ | |
| OLD | NEW |