Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Side by Side Diff: talk/session/media/channel.h

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: google::int32 Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 ContentAction action, 120 ContentAction action,
121 std::string* error_desc); 121 std::string* error_desc);
122 bool SetRemoteContent(const MediaContentDescription* content, 122 bool SetRemoteContent(const MediaContentDescription* content,
123 ContentAction action, 123 ContentAction action,
124 std::string* error_desc); 124 std::string* error_desc);
125 125
126 bool Enable(bool enable); 126 bool Enable(bool enable);
127 127
128 // Multiplexing 128 // Multiplexing
129 bool AddRecvStream(const StreamParams& sp); 129 bool AddRecvStream(const StreamParams& sp);
130 bool RemoveRecvStream(uint32 ssrc); 130 bool RemoveRecvStream(uint32_t ssrc);
131 bool AddSendStream(const StreamParams& sp); 131 bool AddSendStream(const StreamParams& sp);
132 bool RemoveSendStream(uint32 ssrc); 132 bool RemoveSendStream(uint32_t ssrc);
133 133
134 // Monitoring 134 // Monitoring
135 void StartConnectionMonitor(int cms); 135 void StartConnectionMonitor(int cms);
136 void StopConnectionMonitor(); 136 void StopConnectionMonitor();
137 // For ConnectionStatsGetter, used by ConnectionMonitor 137 // For ConnectionStatsGetter, used by ConnectionMonitor
138 virtual bool GetConnectionStats(ConnectionInfos* infos) override; 138 virtual bool GetConnectionStats(ConnectionInfos* infos) override;
139 139
140 void set_srtp_signal_silent_time(uint32 silent_time) { 140 void set_srtp_signal_silent_time(uint32_t silent_time) {
141 srtp_filter_.set_signal_silent_time(silent_time); 141 srtp_filter_.set_signal_silent_time(silent_time);
142 } 142 }
143 143
144 BundleFilter* bundle_filter() { return &bundle_filter_; } 144 BundleFilter* bundle_filter() { return &bundle_filter_; }
145 145
146 const std::vector<StreamParams>& local_streams() const { 146 const std::vector<StreamParams>& local_streams() const {
147 return local_streams_; 147 return local_streams_;
148 } 148 }
149 const std::vector<StreamParams>& remote_streams() const { 149 const std::vector<StreamParams>& remote_streams() const {
150 return remote_streams_; 150 return remote_streams_;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 // Apply the new local/remote session description. 220 // Apply the new local/remote session description.
221 void OnNewLocalDescription(BaseSession* session, ContentAction action); 221 void OnNewLocalDescription(BaseSession* session, ContentAction action);
222 void OnNewRemoteDescription(BaseSession* session, ContentAction action); 222 void OnNewRemoteDescription(BaseSession* session, ContentAction action);
223 223
224 void EnableMedia_w(); 224 void EnableMedia_w();
225 void DisableMedia_w(); 225 void DisableMedia_w();
226 void ChannelWritable_w(); 226 void ChannelWritable_w();
227 void ChannelNotWritable_w(); 227 void ChannelNotWritable_w();
228 bool AddRecvStream_w(const StreamParams& sp); 228 bool AddRecvStream_w(const StreamParams& sp);
229 bool RemoveRecvStream_w(uint32 ssrc); 229 bool RemoveRecvStream_w(uint32_t ssrc);
230 bool AddSendStream_w(const StreamParams& sp); 230 bool AddSendStream_w(const StreamParams& sp);
231 bool RemoveSendStream_w(uint32 ssrc); 231 bool RemoveSendStream_w(uint32_t ssrc);
232 virtual bool ShouldSetupDtlsSrtp() const; 232 virtual bool ShouldSetupDtlsSrtp() const;
233 // Do the DTLS key expansion and impose it on the SRTP/SRTCP filters. 233 // Do the DTLS key expansion and impose it on the SRTP/SRTCP filters.
234 // |rtcp_channel| indicates whether to set up the RTP or RTCP filter. 234 // |rtcp_channel| indicates whether to set up the RTP or RTCP filter.
235 bool SetupDtlsSrtp(bool rtcp_channel); 235 bool SetupDtlsSrtp(bool rtcp_channel);
236 // Set the DTLS-SRTP cipher policy on this channel as appropriate. 236 // Set the DTLS-SRTP cipher policy on this channel as appropriate.
237 bool SetDtlsSrtpCiphers(TransportChannel *tc, bool rtcp); 237 bool SetDtlsSrtpCiphers(TransportChannel *tc, bool rtcp);
238 238
239 virtual void ChangeState() = 0; 239 virtual void ChangeState() = 0;
240 240
241 // Gets the content info appropriate to the channel (audio or video). 241 // Gets the content info appropriate to the channel (audio or video).
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 321
322 // VoiceChannel is a specialization that adds support for early media, DTMF, 322 // VoiceChannel is a specialization that adds support for early media, DTMF,
323 // and input/output level monitoring. 323 // and input/output level monitoring.
324 class VoiceChannel : public BaseChannel { 324 class VoiceChannel : public BaseChannel {
325 public: 325 public:
326 VoiceChannel(rtc::Thread* thread, MediaEngineInterface* media_engine, 326 VoiceChannel(rtc::Thread* thread, MediaEngineInterface* media_engine,
327 VoiceMediaChannel* channel, BaseSession* session, 327 VoiceMediaChannel* channel, BaseSession* session,
328 const std::string& content_name, bool rtcp); 328 const std::string& content_name, bool rtcp);
329 ~VoiceChannel(); 329 ~VoiceChannel();
330 bool Init(); 330 bool Init();
331 bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer); 331 bool SetRemoteRenderer(uint32_t ssrc, AudioRenderer* renderer);
332 332
333 // Configure sending media on the stream with SSRC |ssrc| 333 // Configure sending media on the stream with SSRC |ssrc|
334 // If there is only one sending stream SSRC 0 can be used. 334 // If there is only one sending stream SSRC 0 can be used.
335 bool SetAudioSend(uint32 ssrc, bool mute, const AudioOptions* options, 335 bool SetAudioSend(uint32_t ssrc,
336 bool mute,
337 const AudioOptions* options,
336 AudioRenderer* renderer); 338 AudioRenderer* renderer);
337 339
338 // downcasts a MediaChannel 340 // downcasts a MediaChannel
339 virtual VoiceMediaChannel* media_channel() const { 341 virtual VoiceMediaChannel* media_channel() const {
340 return static_cast<VoiceMediaChannel*>(BaseChannel::media_channel()); 342 return static_cast<VoiceMediaChannel*>(BaseChannel::media_channel());
341 } 343 }
342 344
343 bool SetRingbackTone(const void* buf, int len); 345 bool SetRingbackTone(const void* buf, int len);
344 void SetEarlyMedia(bool enable); 346 void SetEarlyMedia(bool enable);
345 // This signal is emitted when we have gone a period of time without 347 // This signal is emitted when we have gone a period of time without
346 // receiving early media. When received, a UI should start playing its 348 // receiving early media. When received, a UI should start playing its
347 // own ringing sound 349 // own ringing sound
348 sigslot::signal1<VoiceChannel*> SignalEarlyMediaTimeout; 350 sigslot::signal1<VoiceChannel*> SignalEarlyMediaTimeout;
349 351
350 bool PlayRingbackTone(uint32 ssrc, bool play, bool loop); 352 bool PlayRingbackTone(uint32_t ssrc, bool play, bool loop);
351 // TODO(ronghuawu): Replace PressDTMF with InsertDtmf. 353 // TODO(ronghuawu): Replace PressDTMF with InsertDtmf.
352 bool PressDTMF(int digit, bool playout); 354 bool PressDTMF(int digit, bool playout);
353 // Returns if the telephone-event has been negotiated. 355 // Returns if the telephone-event has been negotiated.
354 bool CanInsertDtmf(); 356 bool CanInsertDtmf();
355 // Send and/or play a DTMF |event| according to the |flags|. 357 // Send and/or play a DTMF |event| according to the |flags|.
356 // The DTMF out-of-band signal will be used on sending. 358 // The DTMF out-of-band signal will be used on sending.
357 // The |ssrc| should be either 0 or a valid send stream ssrc. 359 // The |ssrc| should be either 0 or a valid send stream ssrc.
358 // The valid value for the |event| are 0 which corresponding to DTMF 360 // The valid value for the |event| are 0 which corresponding to DTMF
359 // event 0-9, *, #, A-D. 361 // event 0-9, *, #, A-D.
360 bool InsertDtmf(uint32 ssrc, int event_code, int duration, int flags); 362 bool InsertDtmf(uint32_t ssrc, int event_code, int duration, int flags);
361 bool SetOutputScaling(uint32 ssrc, double left, double right); 363 bool SetOutputScaling(uint32_t ssrc, double left, double right);
362 // Get statistics about the current media session. 364 // Get statistics about the current media session.
363 bool GetStats(VoiceMediaInfo* stats); 365 bool GetStats(VoiceMediaInfo* stats);
364 366
365 // Monitoring functions 367 // Monitoring functions
366 sigslot::signal2<VoiceChannel*, const std::vector<ConnectionInfo>&> 368 sigslot::signal2<VoiceChannel*, const std::vector<ConnectionInfo>&>
367 SignalConnectionMonitor; 369 SignalConnectionMonitor;
368 370
369 void StartMediaMonitor(int cms); 371 void StartMediaMonitor(int cms);
370 void StopMediaMonitor(); 372 void StopMediaMonitor();
371 sigslot::signal2<VoiceChannel*, const VoiceMediaInfo&> SignalMediaMonitor; 373 sigslot::signal2<VoiceChannel*, const VoiceMediaInfo&> SignalMediaMonitor;
372 374
373 void StartAudioMonitor(int cms); 375 void StartAudioMonitor(int cms);
374 void StopAudioMonitor(); 376 void StopAudioMonitor();
375 bool IsAudioMonitorRunning() const; 377 bool IsAudioMonitorRunning() const;
376 sigslot::signal2<VoiceChannel*, const AudioInfo&> SignalAudioMonitor; 378 sigslot::signal2<VoiceChannel*, const AudioInfo&> SignalAudioMonitor;
377 379
378 int GetInputLevel_w(); 380 int GetInputLevel_w();
379 int GetOutputLevel_w(); 381 int GetOutputLevel_w();
380 void GetActiveStreams_w(AudioInfo::StreamList* actives); 382 void GetActiveStreams_w(AudioInfo::StreamList* actives);
381 383
382 // Signal errors from VoiceMediaChannel. Arguments are: 384 // Signal errors from VoiceMediaChannel. Arguments are:
383 // ssrc(uint32), and error(VoiceMediaChannel::Error). 385 // ssrc(uint32_t), and error(VoiceMediaChannel::Error).
384 sigslot::signal3<VoiceChannel*, uint32, VoiceMediaChannel::Error> 386 sigslot::signal3<VoiceChannel*, uint32_t, VoiceMediaChannel::Error>
385 SignalMediaError; 387 SignalMediaError;
386 388
387 private: 389 private:
388 // overrides from BaseChannel 390 // overrides from BaseChannel
389 virtual void OnChannelRead(TransportChannel* channel, 391 virtual void OnChannelRead(TransportChannel* channel,
390 const char* data, size_t len, 392 const char* data, size_t len,
391 const rtc::PacketTime& packet_time, 393 const rtc::PacketTime& packet_time,
392 int flags); 394 int flags);
393 virtual void ChangeState(); 395 virtual void ChangeState();
394 virtual const ContentInfo* GetFirstContent(const SessionDescription* sdesc); 396 virtual const ContentInfo* GetFirstContent(const SessionDescription* sdesc);
395 virtual bool SetLocalContent_w(const MediaContentDescription* content, 397 virtual bool SetLocalContent_w(const MediaContentDescription* content,
396 ContentAction action, 398 ContentAction action,
397 std::string* error_desc); 399 std::string* error_desc);
398 virtual bool SetRemoteContent_w(const MediaContentDescription* content, 400 virtual bool SetRemoteContent_w(const MediaContentDescription* content,
399 ContentAction action, 401 ContentAction action,
400 std::string* error_desc); 402 std::string* error_desc);
401 bool SetRingbackTone_w(const void* buf, int len); 403 bool SetRingbackTone_w(const void* buf, int len);
402 bool PlayRingbackTone_w(uint32 ssrc, bool play, bool loop); 404 bool PlayRingbackTone_w(uint32_t ssrc, bool play, bool loop);
403 void HandleEarlyMediaTimeout(); 405 void HandleEarlyMediaTimeout();
404 bool InsertDtmf_w(uint32 ssrc, int event, int duration, int flags); 406 bool InsertDtmf_w(uint32_t ssrc, int event, int duration, int flags);
405 bool SetOutputScaling_w(uint32 ssrc, double left, double right); 407 bool SetOutputScaling_w(uint32_t ssrc, double left, double right);
406 bool GetStats_w(VoiceMediaInfo* stats); 408 bool GetStats_w(VoiceMediaInfo* stats);
407 409
408 virtual void OnMessage(rtc::Message* pmsg); 410 virtual void OnMessage(rtc::Message* pmsg);
409 virtual void GetSrtpCiphers(std::vector<std::string>* ciphers) const; 411 virtual void GetSrtpCiphers(std::vector<std::string>* ciphers) const;
410 virtual void OnConnectionMonitorUpdate( 412 virtual void OnConnectionMonitorUpdate(
411 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); 413 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos);
412 virtual void OnMediaMonitorUpdate( 414 virtual void OnMediaMonitorUpdate(
413 VoiceMediaChannel* media_channel, const VoiceMediaInfo& info); 415 VoiceMediaChannel* media_channel, const VoiceMediaInfo& info);
414 void OnAudioMonitorUpdate(AudioMonitor* monitor, const AudioInfo& info); 416 void OnAudioMonitorUpdate(AudioMonitor* monitor, const AudioInfo& info);
415 void OnVoiceChannelError(uint32 ssrc, VoiceMediaChannel::Error error); 417 void OnVoiceChannelError(uint32_t ssrc, VoiceMediaChannel::Error error);
416 void SendLastMediaError(); 418 void SendLastMediaError();
417 void OnSrtpError(uint32 ssrc, SrtpFilter::Mode mode, SrtpFilter::Error error); 419 void OnSrtpError(uint32_t ssrc,
420 SrtpFilter::Mode mode,
421 SrtpFilter::Error error);
418 422
419 static const int kEarlyMediaTimeout = 1000; 423 static const int kEarlyMediaTimeout = 1000;
420 MediaEngineInterface* media_engine_; 424 MediaEngineInterface* media_engine_;
421 bool received_media_; 425 bool received_media_;
422 rtc::scoped_ptr<VoiceMediaMonitor> media_monitor_; 426 rtc::scoped_ptr<VoiceMediaMonitor> media_monitor_;
423 rtc::scoped_ptr<AudioMonitor> audio_monitor_; 427 rtc::scoped_ptr<AudioMonitor> audio_monitor_;
424 428
425 // Last AudioSendParameters sent down to the media_channel() via 429 // Last AudioSendParameters sent down to the media_channel() via
426 // SetSendParameters. 430 // SetSendParameters.
427 AudioSendParameters last_send_params_; 431 AudioSendParameters last_send_params_;
428 // Last AudioRecvParameters sent down to the media_channel() via 432 // Last AudioRecvParameters sent down to the media_channel() via
429 // SetRecvParameters. 433 // SetRecvParameters.
430 AudioRecvParameters last_recv_params_; 434 AudioRecvParameters last_recv_params_;
431 }; 435 };
432 436
433 // VideoChannel is a specialization for video. 437 // VideoChannel is a specialization for video.
434 class VideoChannel : public BaseChannel { 438 class VideoChannel : public BaseChannel {
435 public: 439 public:
436 VideoChannel(rtc::Thread* thread, VideoMediaChannel* channel, 440 VideoChannel(rtc::Thread* thread, VideoMediaChannel* channel,
437 BaseSession* session, const std::string& content_name, 441 BaseSession* session, const std::string& content_name,
438 bool rtcp); 442 bool rtcp);
439 ~VideoChannel(); 443 ~VideoChannel();
440 bool Init(); 444 bool Init();
441 445
442 // downcasts a MediaChannel 446 // downcasts a MediaChannel
443 virtual VideoMediaChannel* media_channel() const { 447 virtual VideoMediaChannel* media_channel() const {
444 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); 448 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel());
445 } 449 }
446 450
447 bool SetRenderer(uint32 ssrc, VideoRenderer* renderer); 451 bool SetRenderer(uint32_t ssrc, VideoRenderer* renderer);
448 bool ApplyViewRequest(const ViewRequest& request); 452 bool ApplyViewRequest(const ViewRequest& request);
449 453
450 // TODO(pthatcher): Refactor to use a "capture id" instead of an 454 // TODO(pthatcher): Refactor to use a "capture id" instead of an
451 // ssrc here as the "key". 455 // ssrc here as the "key".
452 // Passes ownership of the capturer to the channel. 456 // Passes ownership of the capturer to the channel.
453 bool AddScreencast(uint32 ssrc, VideoCapturer* capturer); 457 bool AddScreencast(uint32_t ssrc, VideoCapturer* capturer);
454 bool SetCapturer(uint32 ssrc, VideoCapturer* capturer); 458 bool SetCapturer(uint32_t ssrc, VideoCapturer* capturer);
455 bool RemoveScreencast(uint32 ssrc); 459 bool RemoveScreencast(uint32_t ssrc);
456 // True if we've added a screencast. Doesn't matter if the capturer 460 // True if we've added a screencast. Doesn't matter if the capturer
457 // has been started or not. 461 // has been started or not.
458 bool IsScreencasting(); 462 bool IsScreencasting();
459 int GetScreencastFps(uint32 ssrc); 463 int GetScreencastFps(uint32_t ssrc);
460 int GetScreencastMaxPixels(uint32 ssrc); 464 int GetScreencastMaxPixels(uint32_t ssrc);
461 // Get statistics about the current media session. 465 // Get statistics about the current media session.
462 bool GetStats(VideoMediaInfo* stats); 466 bool GetStats(VideoMediaInfo* stats);
463 467
464 sigslot::signal2<VideoChannel*, const std::vector<ConnectionInfo>&> 468 sigslot::signal2<VideoChannel*, const std::vector<ConnectionInfo>&>
465 SignalConnectionMonitor; 469 SignalConnectionMonitor;
466 470
467 void StartMediaMonitor(int cms); 471 void StartMediaMonitor(int cms);
468 void StopMediaMonitor(); 472 void StopMediaMonitor();
469 sigslot::signal2<VideoChannel*, const VideoMediaInfo&> SignalMediaMonitor; 473 sigslot::signal2<VideoChannel*, const VideoMediaInfo&> SignalMediaMonitor;
470 sigslot::signal2<uint32, rtc::WindowEvent> SignalScreencastWindowEvent; 474 sigslot::signal2<uint32_t, rtc::WindowEvent> SignalScreencastWindowEvent;
471 475
472 bool SendIntraFrame(); 476 bool SendIntraFrame();
473 bool RequestIntraFrame(); 477 bool RequestIntraFrame();
474 sigslot::signal3<VideoChannel*, uint32, VideoMediaChannel::Error> 478 sigslot::signal3<VideoChannel*, uint32_t, VideoMediaChannel::Error>
475 SignalMediaError; 479 SignalMediaError;
476 480
477 // Configure sending media on the stream with SSRC |ssrc| 481 // Configure sending media on the stream with SSRC |ssrc|
478 // If there is only one sending stream SSRC 0 can be used. 482 // If there is only one sending stream SSRC 0 can be used.
479 bool SetVideoSend(uint32 ssrc, bool mute, const VideoOptions* options); 483 bool SetVideoSend(uint32_t ssrc, bool mute, const VideoOptions* options);
480 484
481 private: 485 private:
482 typedef std::map<uint32, VideoCapturer*> ScreencastMap; 486 typedef std::map<uint32_t, VideoCapturer*> ScreencastMap;
483 struct ScreencastDetailsData; 487 struct ScreencastDetailsData;
484 488
485 // overrides from BaseChannel 489 // overrides from BaseChannel
486 virtual void ChangeState(); 490 virtual void ChangeState();
487 virtual const ContentInfo* GetFirstContent(const SessionDescription* sdesc); 491 virtual const ContentInfo* GetFirstContent(const SessionDescription* sdesc);
488 virtual bool SetLocalContent_w(const MediaContentDescription* content, 492 virtual bool SetLocalContent_w(const MediaContentDescription* content,
489 ContentAction action, 493 ContentAction action,
490 std::string* error_desc); 494 std::string* error_desc);
491 virtual bool SetRemoteContent_w(const MediaContentDescription* content, 495 virtual bool SetRemoteContent_w(const MediaContentDescription* content,
492 ContentAction action, 496 ContentAction action,
493 std::string* error_desc); 497 std::string* error_desc);
494 bool ApplyViewRequest_w(const ViewRequest& request); 498 bool ApplyViewRequest_w(const ViewRequest& request);
495 499
496 bool AddScreencast_w(uint32 ssrc, VideoCapturer* capturer); 500 bool AddScreencast_w(uint32_t ssrc, VideoCapturer* capturer);
497 bool RemoveScreencast_w(uint32 ssrc); 501 bool RemoveScreencast_w(uint32_t ssrc);
498 void OnScreencastWindowEvent_s(uint32 ssrc, rtc::WindowEvent we); 502 void OnScreencastWindowEvent_s(uint32_t ssrc, rtc::WindowEvent we);
499 bool IsScreencasting_w() const; 503 bool IsScreencasting_w() const;
500 void GetScreencastDetails_w(ScreencastDetailsData* d) const; 504 void GetScreencastDetails_w(ScreencastDetailsData* d) const;
501 bool GetStats_w(VideoMediaInfo* stats); 505 bool GetStats_w(VideoMediaInfo* stats);
502 506
503 virtual void OnMessage(rtc::Message* pmsg); 507 virtual void OnMessage(rtc::Message* pmsg);
504 virtual void GetSrtpCiphers(std::vector<std::string>* ciphers) const; 508 virtual void GetSrtpCiphers(std::vector<std::string>* ciphers) const;
505 virtual void OnConnectionMonitorUpdate( 509 virtual void OnConnectionMonitorUpdate(
506 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); 510 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos);
507 virtual void OnMediaMonitorUpdate( 511 virtual void OnMediaMonitorUpdate(
508 VideoMediaChannel* media_channel, const VideoMediaInfo& info); 512 VideoMediaChannel* media_channel, const VideoMediaInfo& info);
509 virtual void OnScreencastWindowEvent(uint32 ssrc, 513 virtual void OnScreencastWindowEvent(uint32_t ssrc, rtc::WindowEvent event);
510 rtc::WindowEvent event);
511 virtual void OnStateChange(VideoCapturer* capturer, CaptureState ev); 514 virtual void OnStateChange(VideoCapturer* capturer, CaptureState ev);
512 bool GetLocalSsrc(const VideoCapturer* capturer, uint32* ssrc); 515 bool GetLocalSsrc(const VideoCapturer* capturer, uint32_t* ssrc);
513 516
514 void OnVideoChannelError(uint32 ssrc, VideoMediaChannel::Error error); 517 void OnVideoChannelError(uint32_t ssrc, VideoMediaChannel::Error error);
515 void OnSrtpError(uint32 ssrc, SrtpFilter::Mode mode, SrtpFilter::Error error); 518 void OnSrtpError(uint32_t ssrc,
519 SrtpFilter::Mode mode,
520 SrtpFilter::Error error);
516 521
517 VideoRenderer* renderer_; 522 VideoRenderer* renderer_;
518 ScreencastMap screencast_capturers_; 523 ScreencastMap screencast_capturers_;
519 rtc::scoped_ptr<VideoMediaMonitor> media_monitor_; 524 rtc::scoped_ptr<VideoMediaMonitor> media_monitor_;
520 525
521 rtc::WindowEvent previous_we_; 526 rtc::WindowEvent previous_we_;
522 527
523 // Last VideoSendParameters sent down to the media_channel() via 528 // Last VideoSendParameters sent down to the media_channel() via
524 // SetSendParameters. 529 // SetSendParameters.
525 VideoSendParameters last_send_params_; 530 VideoSendParameters last_send_params_;
(...skipping 21 matching lines...) Expand all
547 void StopMediaMonitor(); 552 void StopMediaMonitor();
548 553
549 // Should be called on the signaling thread only. 554 // Should be called on the signaling thread only.
550 bool ready_to_send_data() const { 555 bool ready_to_send_data() const {
551 return ready_to_send_data_; 556 return ready_to_send_data_;
552 } 557 }
553 558
554 sigslot::signal2<DataChannel*, const DataMediaInfo&> SignalMediaMonitor; 559 sigslot::signal2<DataChannel*, const DataMediaInfo&> SignalMediaMonitor;
555 sigslot::signal2<DataChannel*, const std::vector<ConnectionInfo>&> 560 sigslot::signal2<DataChannel*, const std::vector<ConnectionInfo>&>
556 SignalConnectionMonitor; 561 SignalConnectionMonitor;
557 sigslot::signal3<DataChannel*, uint32, DataMediaChannel::Error> 562 sigslot::signal3<DataChannel*, uint32_t, DataMediaChannel::Error>
558 SignalMediaError; 563 SignalMediaError;
559 sigslot::signal3<DataChannel*, 564 sigslot::signal3<DataChannel*,
560 const ReceiveDataParams&, 565 const ReceiveDataParams&,
561 const rtc::Buffer&> 566 const rtc::Buffer&>
562 SignalDataReceived; 567 SignalDataReceived;
563 // Signal for notifying when the channel becomes ready to send data. 568 // Signal for notifying when the channel becomes ready to send data.
564 // That occurs when the channel is enabled, the transport is writable, 569 // That occurs when the channel is enabled, the transport is writable,
565 // both local and remote descriptions are set, and the channel is unblocked. 570 // both local and remote descriptions are set, and the channel is unblocked.
566 sigslot::signal1<bool> SignalReadyToSendData; 571 sigslot::signal1<bool> SignalReadyToSendData;
567 // Signal for notifying that the remote side has closed the DataChannel. 572 // Signal for notifying that the remote side has closed the DataChannel.
568 sigslot::signal1<uint32> SignalStreamClosedRemotely; 573 sigslot::signal1<uint32_t> SignalStreamClosedRemotely;
569 574
570 protected: 575 protected:
571 // downcasts a MediaChannel. 576 // downcasts a MediaChannel.
572 virtual DataMediaChannel* media_channel() const { 577 virtual DataMediaChannel* media_channel() const {
573 return static_cast<DataMediaChannel*>(BaseChannel::media_channel()); 578 return static_cast<DataMediaChannel*>(BaseChannel::media_channel());
574 } 579 }
575 580
576 private: 581 private:
577 struct SendDataMessageData : public rtc::MessageData { 582 struct SendDataMessageData : public rtc::MessageData {
578 SendDataMessageData(const SendDataParams& params, 583 SendDataMessageData(const SendDataParams& params,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 632
628 virtual void OnMessage(rtc::Message* pmsg); 633 virtual void OnMessage(rtc::Message* pmsg);
629 virtual void GetSrtpCiphers(std::vector<std::string>* ciphers) const; 634 virtual void GetSrtpCiphers(std::vector<std::string>* ciphers) const;
630 virtual void OnConnectionMonitorUpdate( 635 virtual void OnConnectionMonitorUpdate(
631 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos); 636 ConnectionMonitor* monitor, const std::vector<ConnectionInfo>& infos);
632 virtual void OnMediaMonitorUpdate( 637 virtual void OnMediaMonitorUpdate(
633 DataMediaChannel* media_channel, const DataMediaInfo& info); 638 DataMediaChannel* media_channel, const DataMediaInfo& info);
634 virtual bool ShouldSetupDtlsSrtp() const; 639 virtual bool ShouldSetupDtlsSrtp() const;
635 void OnDataReceived( 640 void OnDataReceived(
636 const ReceiveDataParams& params, const char* data, size_t len); 641 const ReceiveDataParams& params, const char* data, size_t len);
637 void OnDataChannelError(uint32 ssrc, DataMediaChannel::Error error); 642 void OnDataChannelError(uint32_t ssrc, DataMediaChannel::Error error);
638 void OnDataChannelReadyToSend(bool writable); 643 void OnDataChannelReadyToSend(bool writable);
639 void OnSrtpError(uint32 ssrc, SrtpFilter::Mode mode, SrtpFilter::Error error); 644 void OnSrtpError(uint32_t ssrc,
640 void OnStreamClosedRemotely(uint32 sid); 645 SrtpFilter::Mode mode,
646 SrtpFilter::Error error);
647 void OnStreamClosedRemotely(uint32_t sid);
641 648
642 rtc::scoped_ptr<DataMediaMonitor> media_monitor_; 649 rtc::scoped_ptr<DataMediaMonitor> media_monitor_;
643 // TODO(pthatcher): Make a separate SctpDataChannel and 650 // TODO(pthatcher): Make a separate SctpDataChannel and
644 // RtpDataChannel instead of using this. 651 // RtpDataChannel instead of using this.
645 DataChannelType data_channel_type_; 652 DataChannelType data_channel_type_;
646 bool ready_to_send_data_; 653 bool ready_to_send_data_;
647 654
648 // Last DataSendParameters sent down to the media_channel() via 655 // Last DataSendParameters sent down to the media_channel() via
649 // SetSendParameters. 656 // SetSendParameters.
650 DataSendParameters last_send_params_; 657 DataSendParameters last_send_params_;
651 // Last DataRecvParameters sent down to the media_channel() via 658 // Last DataRecvParameters sent down to the media_channel() via
652 // SetRecvParameters. 659 // SetRecvParameters.
653 DataRecvParameters last_recv_params_; 660 DataRecvParameters last_recv_params_;
654 }; 661 };
655 662
656 } // namespace cricket 663 } // namespace cricket
657 664
658 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ 665 #endif // TALK_SESSION_MEDIA_CHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698