In addition to the code moved from talk/app/webrtc there were some files in webrtc/api/objctests that still had the libjingle license header. BUG=webrtc:5418 TBR=tkchin@webrtc.org NOTRY=True Review URL: https://codereview.webrtc.org/1680293005 Cr-Commit-Position: refs/heads/master@{#11552}
55 lines
1.8 KiB
C++
55 lines
1.8 KiB
C++
/*
|
|
* 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:
|
|
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 AddRenderer(VideoRendererInterface* renderer);
|
|
void RemoveRenderer(VideoRendererInterface* renderer);
|
|
void SetEnabled(bool enable);
|
|
|
|
private:
|
|
// Pass the frame on to to each registered renderer. Requires
|
|
// critical_section_ already locked.
|
|
void RenderFrameToRenderers(const cricket::VideoFrame* frame);
|
|
|
|
bool enabled_;
|
|
std::set<VideoRendererInterface*> renderers_;
|
|
|
|
rtc::CriticalSection critical_section_; // Protects the above variables
|
|
};
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // WEBRTC_API_VIDEOTRACKRENDERERS_H_
|