blob: 1019ec387dbef0388e5121796c5a951f7809b222 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media_component_device.h"
namespace chromecast {
struct Size;
namespace media {
struct VideoConfig;
// Interface for platform-specific video pipeline backend.
// See comments on MediaComponentDevice.
// Notes:
// - Like a regular MediaComponentDevice, frames are possibly rendered only
// in the kRunning state.
// However, the first frame must be rendered regardless of the clock state:
// - no synchronization needed to display the first frame,
// - the clock rate has no impact on the presentation of the first frame.
class VideoPipelineDevice : public MediaComponentDevice {
// Callback interface for natural size of video changing.
class VideoClient {
virtual ~VideoClient() {}
virtual void OnNaturalSizeChanged(const Size& size) = 0;
~VideoPipelineDevice() override {}
// Registers |client| as the video specific event handler.
// Implementation takes ownership of |client|.
virtual void SetVideoClient(VideoClient* client) = 0;
// Provides the video configuration.
// Called before switching from |kStateUninitialized| to |kStateIdle|.
// Afterwards, this can be invoked any time the configuration changes.
// Returns true if the configuration is a supported configuration.
virtual bool SetConfig(const VideoConfig& config) = 0;
} // namespace media
} // namespace chromecast