• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3  *
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.
9  */
10 
11 #include <string>
12 #include <vector>
13 
14 #include "webrtc/base/constructormagic.h"
15 #include "webrtc/modules/video_coding/main/interface/video_coding_defines.h"
16 #include "webrtc/modules/video_coding/main/test/rtp_player.h"
17 #include "webrtc/system_wrappers/interface/scoped_ptr.h"
18 
19 class NullEventFactory;
20 
21 namespace webrtc {
22 class Clock;
23 class CriticalSectionWrapper;
24 
25 namespace rtpplayer {
26 class VcmPayloadSinkFactory : public PayloadSinkFactoryInterface {
27  public:
28   VcmPayloadSinkFactory(const std::string& base_out_filename,
29                         Clock* clock, bool protection_enabled,
30                         VCMVideoProtection protection_method,
31                         uint32_t rtt_ms, uint32_t render_delay_ms,
32                         uint32_t min_playout_delay_ms);
33   virtual ~VcmPayloadSinkFactory();
34 
35   // PayloadSinkFactoryInterface
36   virtual PayloadSinkInterface* Create(RtpStreamInterface* stream);
37 
38   int DecodeAndProcessAll(bool decode_dual_frame);
39   bool ProcessAll();
40   bool DecodeAll();
41 
42  private:
43   class VcmPayloadSink;
44   friend class VcmPayloadSink;
45   typedef std::vector<VcmPayloadSink*> Sinks;
46 
47   void Remove(VcmPayloadSink* sink);
48 
49   std::string base_out_filename_;
50   Clock* clock_;
51   bool protection_enabled_;
52   VCMVideoProtection protection_method_;
53   uint32_t rtt_ms_;
54   uint32_t render_delay_ms_;
55   uint32_t min_playout_delay_ms_;
56   scoped_ptr<NullEventFactory> null_event_factory_;
57   scoped_ptr<CriticalSectionWrapper> crit_sect_;
58   Sinks sinks_;
59 
60   DISALLOW_IMPLICIT_CONSTRUCTORS(VcmPayloadSinkFactory);
61 };
62 }  // namespace rtpplayer
63 }  // namespace webrtc
64