diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/renderer/media/cast_rtp_stream.cc | 22 | ||||
-rw-r--r-- | chrome/renderer/media/cast_rtp_stream.h | 1 | ||||
-rw-r--r-- | chrome/test/data/extensions/api_test/cast_streaming/rtp_stream_error.js | 5 |
3 files changed, 3 insertions, 25 deletions
diff --git a/chrome/renderer/media/cast_rtp_stream.cc b/chrome/renderer/media/cast_rtp_stream.cc index 4d51889..a3f970d 100644 --- a/chrome/renderer/media/cast_rtp_stream.cc +++ b/chrome/renderer/media/cast_rtp_stream.cc @@ -214,10 +214,6 @@ bool ToVideoSenderConfig(const CastRtpParams& params, if (config->min_playout_delay > config->max_playout_delay) return false; config->rtp_payload_type = params.payload.payload_type; - config->width = params.payload.width; - config->height = params.payload.height; - if (config->width < 2 || config->height < 2) - return false; config->min_bitrate = config->start_bitrate = params.payload.min_bitrate * kBitrateMultiplier; config->max_bitrate = params.payload.max_bitrate * kBitrateMultiplier; @@ -257,14 +253,11 @@ class CastVideoSink : public base::SupportsWeakPtr<CastVideoSink>, public content::MediaStreamVideoSink { public: // |track| provides data for this sink. - // |expected_natural_size| is the expected dimension of the video frame. // |error_callback| is called if video formats don't match. CastVideoSink(const blink::WebMediaStreamTrack& track, - const gfx::Size& expected_natural_size, const CastRtpStream::ErrorCallback& error_callback) : track_(track), sink_added_(false), - expected_natural_size_(expected_natural_size), error_callback_(error_callback) {} ~CastVideoSink() override { @@ -275,24 +268,12 @@ class CastVideoSink : public base::SupportsWeakPtr<CastVideoSink>, // This static method is used to forward video frames to |frame_input|. static void OnVideoFrame( // These parameters are already bound when callback is created. - const gfx::Size& expected_natural_size, const CastRtpStream::ErrorCallback& error_callback, const scoped_refptr<media::cast::VideoFrameInput> frame_input, // These parameters are passed for each frame. const scoped_refptr<media::VideoFrame>& frame, const media::VideoCaptureFormat& format, const base::TimeTicks& estimated_capture_time) { - if (frame->natural_size() != expected_natural_size) { - error_callback.Run( - base::StringPrintf("Video frame resolution does not match config." - " Expected %dx%d. Got %dx%d.", - expected_natural_size.width(), - expected_natural_size.height(), - frame->natural_size().width(), - frame->natural_size().height())); - return; - } - base::TimeTicks timestamp; if (estimated_capture_time.is_null()) timestamp = base::TimeTicks::Now(); @@ -318,7 +299,6 @@ class CastVideoSink : public base::SupportsWeakPtr<CastVideoSink>, this, base::Bind( &CastVideoSink::OnVideoFrame, - expected_natural_size_, error_callback_, frame_input), track_); @@ -327,7 +307,6 @@ class CastVideoSink : public base::SupportsWeakPtr<CastVideoSink>, private: blink::WebMediaStreamTrack track_; bool sink_added_; - gfx::Size expected_natural_size_; CastRtpStream::ErrorCallback error_callback_; DISALLOW_COPY_AND_ASSIGN(CastVideoSink); @@ -543,7 +522,6 @@ void CastRtpStream::Start(const CastRtpParams& params, // See the code for audio above for explanation of callbacks. video_sink_.reset(new CastVideoSink( track_, - gfx::Size(config.width, config.height), media::BindToCurrentLoop(base::Bind(&CastRtpStream::DidEncounterError, weak_factory_.GetWeakPtr())))); cast_session_->StartVideo( diff --git a/chrome/renderer/media/cast_rtp_stream.h b/chrome/renderer/media/cast_rtp_stream.h index 24bf885..61a6bf4 100644 --- a/chrome/renderer/media/cast_rtp_stream.h +++ b/chrome/renderer/media/cast_rtp_stream.h @@ -68,6 +68,7 @@ struct CastRtpPayloadParams { double max_frame_rate; // Width and height of the video content. + // TODO(miu): DEPRECATED. Remove these, as they are ignored. int width; int height; diff --git a/chrome/test/data/extensions/api_test/cast_streaming/rtp_stream_error.js b/chrome/test/data/extensions/api_test/cast_streaming/rtp_stream_error.js index 5cdba8a..9db1949 100644 --- a/chrome/test/data/extensions/api_test/cast_streaming/rtp_stream_error.js +++ b/chrome/test/data/extensions/api_test/cast_streaming/rtp_stream_error.js @@ -39,9 +39,8 @@ chrome.test.runTests([ udpTransport.destroy(udpId); console.log(msg); }.bind(null, audioId, videoId))); - // Invalid width and height. - videoParams.payload.width = 100; - videoParams.payload.height = 100; + // Specify invalid value to trigger error. + videoParams.payload.codecName = "Animated WebP"; udpTransport.setDestination(udpId, {address: "127.0.0.1", port: 2344}); rtpStream.start(videoId, videoParams); |