OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2009 Google Inc. | 3 * Copyright 2009 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 2484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2495 } | 2495 } |
2496 | 2496 |
2497 TEST_F(VideoChannelTest, TestOnReadyToSend) { | 2497 TEST_F(VideoChannelTest, TestOnReadyToSend) { |
2498 Base::TestOnReadyToSend(); | 2498 Base::TestOnReadyToSend(); |
2499 } | 2499 } |
2500 | 2500 |
2501 TEST_F(VideoChannelTest, TestOnReadyToSendWithRtcpMux) { | 2501 TEST_F(VideoChannelTest, TestOnReadyToSendWithRtcpMux) { |
2502 Base::TestOnReadyToSendWithRtcpMux(); | 2502 Base::TestOnReadyToSendWithRtcpMux(); |
2503 } | 2503 } |
2504 | 2504 |
2505 TEST_F(VideoChannelTest, TestApplyViewRequest) { | |
2506 CreateChannels(0, 0); | |
2507 cricket::StreamParams stream2; | |
2508 stream2.id = "stream2"; | |
2509 stream2.ssrcs.push_back(2222); | |
2510 local_media_content1_.AddStream(stream2); | |
2511 | |
2512 EXPECT_TRUE(SendInitiate()); | |
2513 EXPECT_TRUE(SendAccept()); | |
2514 | |
2515 cricket::VideoFormat send_format; | |
2516 EXPECT_TRUE(media_channel1_->GetSendStreamFormat(kSsrc1, &send_format)); | |
2517 EXPECT_EQ(640, send_format.width); | |
2518 EXPECT_EQ(400, send_format.height); | |
2519 EXPECT_EQ(cricket::VideoFormat::FpsToInterval(30), send_format.interval); | |
2520 | |
2521 cricket::ViewRequest request; | |
2522 // stream1: 320x200x15; stream2: 0x0x0 | |
2523 request.static_video_views.push_back(cricket::StaticVideoView( | |
2524 cricket::StreamSelector(kSsrc1), 320, 200, 15)); | |
2525 EXPECT_TRUE(channel1_->ApplyViewRequest(request)); | |
2526 EXPECT_TRUE(media_channel1_->GetSendStreamFormat(kSsrc1, &send_format)); | |
2527 EXPECT_EQ(320, send_format.width); | |
2528 EXPECT_EQ(200, send_format.height); | |
2529 EXPECT_EQ(cricket::VideoFormat::FpsToInterval(15), send_format.interval); | |
2530 EXPECT_TRUE(media_channel1_->GetSendStreamFormat(2222, &send_format)); | |
2531 EXPECT_EQ(0, send_format.width); | |
2532 EXPECT_EQ(0, send_format.height); | |
2533 | |
2534 // stream1: 160x100x8; stream2: 0x0x0 | |
2535 request.static_video_views.clear(); | |
2536 request.static_video_views.push_back(cricket::StaticVideoView( | |
2537 cricket::StreamSelector(kSsrc1), 160, 100, 8)); | |
2538 EXPECT_TRUE(channel1_->ApplyViewRequest(request)); | |
2539 EXPECT_TRUE(media_channel1_->GetSendStreamFormat(kSsrc1, &send_format)); | |
2540 EXPECT_EQ(160, send_format.width); | |
2541 EXPECT_EQ(100, send_format.height); | |
2542 EXPECT_EQ(cricket::VideoFormat::FpsToInterval(8), send_format.interval); | |
2543 | |
2544 // stream1: 0x0x0; stream2: 640x400x30 | |
2545 request.static_video_views.clear(); | |
2546 request.static_video_views.push_back(cricket::StaticVideoView( | |
2547 cricket::StreamSelector(std::string(), stream2.id), 640, 400, 30)); | |
2548 EXPECT_TRUE(channel1_->ApplyViewRequest(request)); | |
2549 EXPECT_TRUE(media_channel1_->GetSendStreamFormat(kSsrc1, &send_format)); | |
2550 EXPECT_EQ(0, send_format.width); | |
2551 EXPECT_EQ(0, send_format.height); | |
2552 EXPECT_TRUE(media_channel1_->GetSendStreamFormat(2222, &send_format)); | |
2553 EXPECT_EQ(640, send_format.width); | |
2554 EXPECT_EQ(400, send_format.height); | |
2555 EXPECT_EQ(cricket::VideoFormat::FpsToInterval(30), send_format.interval); | |
2556 | |
2557 // stream1: 0x0x0; stream2: 0x0x0 | |
2558 request.static_video_views.clear(); | |
2559 EXPECT_TRUE(channel1_->ApplyViewRequest(request)); | |
2560 EXPECT_TRUE(media_channel1_->GetSendStreamFormat(kSsrc1, &send_format)); | |
2561 EXPECT_EQ(0, send_format.width); | |
2562 EXPECT_EQ(0, send_format.height); | |
2563 } | |
2564 | |
2565 | |
2566 // DataChannelTest | 2505 // DataChannelTest |
2567 | 2506 |
2568 class DataChannelTest | 2507 class DataChannelTest |
2569 : public ChannelTest<DataTraits> { | 2508 : public ChannelTest<DataTraits> { |
2570 public: | 2509 public: |
2571 typedef ChannelTest<DataTraits> | 2510 typedef ChannelTest<DataTraits> |
2572 Base; | 2511 Base; |
2573 DataChannelTest() | 2512 DataChannelTest() |
2574 : Base(true, | 2513 : Base(true, |
2575 kDataPacket, | 2514 kDataPacket, |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2768 }; | 2707 }; |
2769 rtc::Buffer payload(data, 3); | 2708 rtc::Buffer payload(data, 3); |
2770 cricket::SendDataResult result; | 2709 cricket::SendDataResult result; |
2771 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); | 2710 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); |
2772 EXPECT_EQ(params.ssrc, | 2711 EXPECT_EQ(params.ssrc, |
2773 media_channel1_->last_sent_data_params().ssrc); | 2712 media_channel1_->last_sent_data_params().ssrc); |
2774 EXPECT_EQ("foo", media_channel1_->last_sent_data()); | 2713 EXPECT_EQ("foo", media_channel1_->last_sent_data()); |
2775 } | 2714 } |
2776 | 2715 |
2777 // TODO(pthatcher): TestSetReceiver? | 2716 // TODO(pthatcher): TestSetReceiver? |
OLD | NEW |