/*
 *  Copyright 2012 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#ifndef WEBRTC_API_VIDEOTRACKRENDERERS_H_
#define WEBRTC_API_VIDEOTRACKRENDERERS_H_

#include <set>

#include "webrtc/api/mediastreaminterface.h"
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/media/base/videorenderer.h"

namespace webrtc {

// Class used for rendering cricket::VideoFrames to multiple renderers of type
// VideoRendererInterface.
// Each VideoTrack owns a VideoTrackRenderers instance.
// The class is thread safe. Rendering to the added VideoRendererInterfaces is
// done on the same thread as the cricket::VideoRenderer.
class VideoTrackRenderers
    : public cricket::VideoRenderer,
      public rtc::VideoSourceInterface<cricket::VideoFrame> {
 public:
  VideoTrackRenderers();
  ~VideoTrackRenderers();

  // Implements cricket::VideoRenderer. If the track is disabled,
  // incoming frames are replaced by black frames.
  virtual bool RenderFrame(const cricket::VideoFrame* frame);

  void AddOrUpdateSink(VideoSinkInterface<cricket::VideoFrame>* sink,
                       const rtc::VideoSinkWants& wants) override;
  void RemoveSink(VideoSinkInterface<cricket::VideoFrame>* sink) override;
  void SetEnabled(bool enable);

 private:
  // Pass the frame on to to each registered renderer. Requires
  // critical_section_ already locked.
  void RenderFrameToSinks(const cricket::VideoFrame& frame);

  bool enabled_;
  std::vector<VideoSinkInterface<cricket::VideoFrame>*> sinks_;
  rtc::CriticalSection critical_section_;  // Protects the above variables
};

}  // namespace webrtc

#endif  // WEBRTC_API_VIDEOTRACKRENDERERS_H_
