OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 public: | 55 public: |
56 VideoTrackTest() { | 56 VideoTrackTest() { |
57 static const char kVideoTrackId[] = "track_id"; | 57 static const char kVideoTrackId[] = "track_id"; |
58 | 58 |
59 channel_manager_.reset(new cricket::ChannelManager( | 59 channel_manager_.reset(new cricket::ChannelManager( |
60 new cricket::FakeMediaEngine(), rtc::Thread::Current())); | 60 new cricket::FakeMediaEngine(), rtc::Thread::Current())); |
61 EXPECT_TRUE(channel_manager_->Init()); | 61 EXPECT_TRUE(channel_manager_->Init()); |
62 video_track_ = VideoTrack::Create( | 62 video_track_ = VideoTrack::Create( |
63 kVideoTrackId, | 63 kVideoTrackId, |
64 VideoSource::Create(channel_manager_.get(), | 64 VideoSource::Create(channel_manager_.get(), |
65 new webrtc::RemoteVideoCapturer(), NULL)); | 65 new webrtc::RemoteVideoCapturer(), NULL, true)); |
66 } | 66 } |
67 | 67 |
68 protected: | 68 protected: |
69 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; | 69 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; |
70 rtc::scoped_refptr<VideoTrackInterface> video_track_; | 70 rtc::scoped_refptr<VideoTrackInterface> video_track_; |
71 }; | 71 }; |
72 | 72 |
73 // Test adding renderers to a video track and render to them by providing | 73 // Test adding renderers to a video track and render to them by providing |
74 // frames to the source. | 74 // frames to the source. |
75 TEST_F(VideoTrackTest, RenderVideo) { | 75 TEST_F(VideoTrackTest, RenderVideo) { |
(...skipping 26 matching lines...) Expand all Loading... |
102 | 102 |
103 EXPECT_EQ(2, renderer_1->num_rendered_frames()); | 103 EXPECT_EQ(2, renderer_1->num_rendered_frames()); |
104 EXPECT_EQ(1, renderer_2->num_rendered_frames()); | 104 EXPECT_EQ(1, renderer_2->num_rendered_frames()); |
105 | 105 |
106 video_track_->RemoveRenderer(renderer_1.get()); | 106 video_track_->RemoveRenderer(renderer_1.get()); |
107 renderer_input->RenderFrame(&frame); | 107 renderer_input->RenderFrame(&frame); |
108 | 108 |
109 EXPECT_EQ(2, renderer_1->num_rendered_frames()); | 109 EXPECT_EQ(2, renderer_1->num_rendered_frames()); |
110 EXPECT_EQ(2, renderer_2->num_rendered_frames()); | 110 EXPECT_EQ(2, renderer_2->num_rendered_frames()); |
111 } | 111 } |
OLD | NEW |