Break video_engine/new_include/common.h into smaller parts.

BUG=
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1571005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4128 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org 2013-05-29 11:34:32 +00:00
parent ace7ad2302
commit 1ecee9a15a
16 changed files with 134 additions and 63 deletions

View File

@ -22,7 +22,6 @@
#include "webrtc/video_engine/include/vie_rtp_rtcp.h"
#include "webrtc/video_engine/internal/video_receive_stream.h"
#include "webrtc/video_engine/internal/video_send_stream.h"
#include "webrtc/video_engine/new_include/common.h"
#include "webrtc/video_engine/new_include/video_engine.h"
namespace webrtc {

View File

@ -17,7 +17,6 @@
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
#include "webrtc/video_engine/internal/video_receive_stream.h"
#include "webrtc/video_engine/internal/video_send_stream.h"
#include "webrtc/video_engine/new_include/common.h"
#include "webrtc/video_engine/new_include/video_engine.h"
namespace webrtc {

View File

@ -8,60 +8,14 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_COMMON_H_
#define WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_COMMON_H_
#ifndef WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_
#define WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_
#include <string>
#include "webrtc/common_types.h"
namespace webrtc {
class I420VideoFrame;
namespace newapi {
struct EncodedFrame;
class I420FrameCallback {
public:
// This function is called with a I420 frame allowing the user to modify the
// frame content.
virtual void FrameCallback(I420VideoFrame* video_frame) = 0;
protected:
virtual ~I420FrameCallback() {}
};
class EncodedFrameObserver {
public:
virtual void EncodedFrameCallback(const EncodedFrame& encoded_frame) = 0;
protected:
virtual ~EncodedFrameObserver() {}
};
class VideoRenderer {
public:
// This function should return as soon as possible and not block until it's
// time to render the frame.
// TODO(mflodman) Remove time_to_render_ms when I420VideoFrame contains NTP.
virtual void RenderFrame(const I420VideoFrame& video_frame,
int time_to_render_ms) = 0;
protected:
virtual ~VideoRenderer() {}
};
class Transport {
public:
virtual bool SendRTP(const void* packet, size_t length) = 0;
virtual bool SendRTCP(const void* packet, size_t length) = 0;
protected:
virtual ~Transport() {}
};
struct RtpStatistics {
RtpStatistics()
: ssrc(0),
@ -123,8 +77,7 @@ struct RtpExtension {
std::string name;
int id;
};
} // namespace newapi
} // namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_COMMON_H_
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_

View File

@ -0,0 +1,42 @@
/*
* Copyright (c) 2013 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_VIDEO_ENGINE_NEW_INCLUDE_FRAME_CALLBACK_H_
#define WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_FRAME_CALLBACK_H_
namespace webrtc {
class I420VideoFrame;
namespace newapi {
struct EncodedFrame;
class I420FrameCallback {
public:
// This function is called with a I420 frame allowing the user to modify the
// frame content.
virtual void FrameCallback(I420VideoFrame* video_frame) = 0;
protected:
virtual ~I420FrameCallback() {}
};
class EncodedFrameObserver {
public:
virtual void EncodedFrameCallback(const EncodedFrame& encoded_frame) = 0;
protected:
virtual ~EncodedFrameObserver() {}
};
} // namespace newapi
} // namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_FRAME_CALLBACK_H_

View File

@ -0,0 +1,30 @@
/*
* Copyright (c) 2013 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_VIDEO_ENGINE_NEW_INCLUDE_TRANSPORT_H_
#define WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_TRANSPORT_H_
#include <stddef.h>
namespace webrtc {
namespace newapi {
class Transport {
public:
virtual bool SendRTP(const void* packet, size_t length) = 0;
virtual bool SendRTCP(const void* packet, size_t length) = 0;
protected:
virtual ~Transport() {}
};
} // namespace newapi
} // namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_TRANSPORT_H_

View File

@ -15,7 +15,6 @@
#include <vector>
#include "webrtc/common_types.h"
#include "webrtc/video_engine/new_include/common.h"
#include "webrtc/video_engine/new_include/video_receive_stream.h"
#include "webrtc/video_engine/new_include/video_send_stream.h"

View File

@ -15,7 +15,10 @@
#include <vector>
#include "webrtc/common_types.h"
#include "webrtc/video_engine/new_include/common.h"
#include "webrtc/video_engine/new_include/config.h"
#include "webrtc/video_engine/new_include/frame_callback.h"
#include "webrtc/video_engine/new_include/transport.h"
#include "webrtc/video_engine/new_include/video_renderer.h"
namespace webrtc {

View File

@ -0,0 +1,34 @@
/*
* Copyright (c) 2013 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_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_RENDERER_H_
#define WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_RENDERER_H_
namespace webrtc {
class I420VideoFrame;
namespace newapi {
class VideoRenderer {
public:
// This function should return as soon as possible and not block until it's
// time to render the frame.
// TODO(mflodman) Remove time_to_render_ms when I420VideoFrame contains NTP.
virtual void RenderFrame(const I420VideoFrame& video_frame,
int time_to_render_ms) = 0;
protected:
virtual ~VideoRenderer() {}
};
} // namespace newapi
} // namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_RENDERER_H_

View File

@ -15,7 +15,9 @@
#include <vector>
#include "webrtc/common_types.h"
#include "webrtc/video_engine/new_include/common.h"
#include "webrtc/video_engine/new_include/config.h"
#include "webrtc/video_engine/new_include/frame_callback.h"
#include "webrtc/video_engine/new_include/video_renderer.h"
namespace webrtc {

View File

@ -10,7 +10,7 @@
#ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_DIRECT_TRANSPORT_H_
#define WEBRTC_VIDEO_ENGINE_TEST_COMMON_DIRECT_TRANSPORT_H_
#include "webrtc/video_engine/new_include/common.h"
#include "webrtc/video_engine/new_include/transport.h"
namespace webrtc {
namespace test {

View File

@ -18,6 +18,8 @@
#endif
#include "webrtc/video_engine/test/common/video_renderer.h"
#include "webrtc/typedefs.h"
namespace webrtc {
namespace test {

View File

@ -15,6 +15,7 @@
#include <X11/Xlib.h>
#include "webrtc/video_engine/test/common/gl/gl_renderer.h"
#include "webrtc/typedefs.h"
namespace webrtc {
namespace test {

View File

@ -15,8 +15,8 @@
#include <X11/extensions/XShm.h>
#include <X11/extensions/Xvlib.h>
#include "webrtc/video_engine/new_include/common.h"
#include "webrtc/video_engine/test/common/video_renderer.h"
#include "webrtc/typedefs.h"
namespace webrtc {
namespace test {

View File

@ -13,6 +13,8 @@
// TODO(pbos): Windows renderer
// TODO(pbos): Android renderer
#include "webrtc/typedefs.h"
namespace webrtc {
namespace test {

View File

@ -10,7 +10,9 @@
#ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_VIDEO_RENDERER_H_
#define WEBRTC_VIDEO_ENGINE_TEST_COMMON_VIDEO_RENDERER_H_
#include "webrtc/video_engine/new_include/common.h"
#include <stddef.h>
#include "webrtc/video_engine/new_include/video_renderer.h"
namespace webrtc {
namespace test {

View File

@ -120,17 +120,20 @@
'vie_sync_module.cc',
# New VideoEngine API
'new_include/common.h',
'new_include/video_engine.h',
'new_include/video_receive_stream.h',
'new_include/video_send_stream.h',
'internal/video_engine.cc',
'internal/video_call.cc',
'internal/video_call.h',
'internal/video_engine.cc',
'internal/video_receive_stream.cc',
'internal/video_receive_stream.h',
'internal/video_send_stream.cc',
'internal/video_send_stream.h',
'new_include/config.h',
'new_include/frame_callback.h',
'new_include/transport.h',
'new_include/video_engine.h',
'new_include/video_receive_stream.h',
'new_include/video_renderer.h',
'new_include/video_send_stream.h',
], # source
# TODO(jschuh): Bug 1348: fix size_t to int truncations.
'msvs_disabled_warnings': [ 4267, ],