2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
12 * Common multi-thread functionality across video coding module tests
15 #ifndef WEBRTC_MODULES_VIDEO_CODING_TEST_MT_TEST_COMMON_H_
16 #define WEBRTC_MODULES_VIDEO_CODING_TEST_MT_TEST_COMMON_H_
18 #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h"
19 #include "webrtc/modules/video_coding/main/interface/video_coding.h"
20 #include "webrtc/modules/video_coding/main/test/test_callbacks.h"
21 #include "webrtc/modules/video_coding/main/test/video_source.h"
28 SendSharedState(webrtc::VideoCodingModule& vcm, webrtc::RtpRtcp& rtp,
37 webrtc::VideoCodingModule& _vcm;
38 webrtc::RtpRtcp& _rtp;
45 // MT implementation of the RTPSendCompleteCallback (Transport)
46 class TransportCallback:public RTPSendCompleteCallback
49 // constructor input: (receive side) rtp module to send encoded data to
50 TransportCallback(Clock* clock, const char* filename = NULL);
51 virtual ~TransportCallback();
52 // Add packets to list
53 // Incorporate network conditions - delay and packet loss
54 // Actual transmission will occur on a separate thread
55 virtual int SendPacket(int channel, const void *data, int len) OVERRIDE;
56 // Send to the receiver packets which are ready to be submitted
57 int TransportPackets();
63 SharedRTPState(webrtc::VideoCodingModule& vcm, webrtc::RtpRtcp& rtp) :
66 webrtc::VideoCodingModule& _vcm;
67 webrtc::RtpRtcp& _rtp;
71 class SharedTransportState
74 SharedTransportState(webrtc::RtpRtcp& rtp, TransportCallback& transport):
76 _transport(transport) {}
77 webrtc::RtpRtcp& _rtp;
78 TransportCallback& _transport;
81 bool VCMProcessingThread(void* obj);
82 bool VCMDecodeThread(void* obj);
83 bool TransportThread(void *obj);
87 #endif // WEBRTC_MODULES_VIDEO_CODING_TEST_MT_TEST_COMMON_H_