1. 06 Dec, 2018 3 commits
    • Philippe Gorley's avatar
      recorder: remove dynamic casts · c455eceb
      Philippe Gorley authored
      Have an intermediate object subscribe to the media sources while also
      keeping a copy of the stream name. The recorder can then keep a
      reference to these to figure out the source of the frame, instead of
      knowing what objects it subscribes to.
      
      Change-Id: I4a34c8b035301eefc90645cf6cb500dbcd879f91
      c455eceb
    • Philippe Gorley's avatar
      recorder: make adding streams public · dd6199ac
      Philippe Gorley authored
      Instead of casting the observable object in the attached callback, have
      the recorder's owner add the streams manually.
      
      Change-Id: I5c79e32e470364b0c6a4253f50357a4bafade769
      dd6199ac
    • Philippe Gorley's avatar
      recorder: subscribe to audio/video sources · 351856e7
      Philippe Gorley authored
      Makes the MediaRecorder an observer on AudioInput, AudioReceiveThread,
      VideoInput and VideoReceiveThread, so they no longer need a reference
      to the recorder.
      
      Makes sure the framerate is set for the recorder by adding a way to get
      the stream parameters from the video receiver and input, since AVFrame
      does not carry framerate and time base information.
      
      Adds way to detach the recorder from the media sources, so it can be
      reattached on subsequent records.
      
      Change-Id: I71bac0825541f6445861f4f949288e1c62416f05
      351856e7
  2. 03 Dec, 2018 1 commit
    • Philippe Gorley's avatar
      audio: implement switch input · 10126454
      Philippe Gorley authored
      Lays the groundwork for file streaming by allowing the audio source to
      be changed while an audio input is active.
      
      Don't notify observers if there's no frame.
      
      Renames videoInput_ to mediaInput_ now that it is also used for audio.
      
      Change-Id: I0a10d4a339e77b890ee006a5f977383e8942505b
      10126454
  3. 29 Nov, 2018 1 commit
  4. 19 Nov, 2018 1 commit
    • Philippe Gorley's avatar
      media_stream: add frame size · 46fdc9d9
      Philippe Gorley authored
      This will help once audio streaming is implemented, as the encoder will
      need to know the number of samples per frame in the decoded file.
      
      Change-Id: I6d6375b46d74eec6618c0f1e7ee1f07fd86b6e45
      46fdc9d9
  5. 08 Nov, 2018 2 commits
    • Philippe Gorley's avatar
      media: simplify timestamp computation · d36d4d6e
      Philippe Gorley authored
      Audio time bases are always the inverse of the sample rate, meaning the
      increment is always the number of samples in a frame. Video usually has
      a time base inverse of its framerate, but this is not always the case.
      
      Change-Id: I50d2d84d073052f8b3a832e8b99725b9d66b12a8
      d36d4d6e
    • Philippe Gorley's avatar
      audio: stash active inputs in videomanager · e86600b6
      Philippe Gorley authored
      Needed for audio streaming because the audio input needs to be accessed
      at call level so it can tell the input to switch to a file or a
      different input.
      
      Getting a shared pointer to an AudioInput should only be done during
      setup, so as to not walk the whole map in audio processing loops.
      
      Change-Id: I49be1cb3c641b50e6f70356f330d40e1c27bef61
      e86600b6
  6. 01 Nov, 2018 1 commit
    • Philippe Gorley's avatar
      audio: use input as audio source · ddcda82e
      Philippe Gorley authored
      AudioInput now manages audio frames, not AudioSender.
      Makes AudioInput observable.
      AudioSender subscribes to AudioInput.
      
      LocalRecorder does not need to observe AudioInput or VideoInput because
      these already record frames. Will be done in future work on the recording
      system.
      
      Change-Id: I011d742063386498d59b2962f7c333b999d0921c
      ddcda82e
  7. 22 Oct, 2018 2 commits
    • Philippe Gorley's avatar
      audiobuffer: use raii when dealing with AVFrame · 222ce2c0
      Philippe Gorley authored
      Returns AudioFrame instead of raw AVFRame pointer when calling
      AudioBuffer.toAVFrame, and take AudioFrame as parameter when appending
      an AVFrame to an AudioBuffer.
      
      No longer need to free AVFrame during encoding/conversions.
      
      Change-Id: I28aa992a5483f84f6cb1a5157718c11c3a69518c
      222ce2c0
    • Philippe Gorley's avatar
      smartools: avoid repeated calls · 83a129c5
      Philippe Gorley authored
      Resolution/codecs won't change without a SIP renegotiation.
      
      Change-Id: Ie6d393caa5a3e631c7be14356a7929c0f11e781c
      83a129c5
  8. 11 Sep, 2018 1 commit
    • Hugo Lefeuvre's avatar
      audio: implement audio_input class · a774e0f4
      Hugo Lefeuvre authored
      The audioInput class allows easy retrieval of local audio stream
      without being in a running call. For now it is only used to record
      audio data but might be employed for other purposes with little design
      changes.
      
      Change-Id: Icdf6a9799f341367b0c50aaff76b8642f42d0d1c
      a774e0f4
  9. 23 Aug, 2018 1 commit
    • Philippe Gorley's avatar
      recorder: refactor and simplify · f1088fa8
      Philippe Gorley authored
      1. Adds constness to streams in MediaRecorder; the latter shouldn't change
      stream parameters.
      2. addStream is called from recordData to simplify workflow; users need
      only check that MediaRecorder is recording.
      3. Fixes regression where multiple records couldn't happen in the same
      call.
      4. Fixes AudioSender not sending starting timestamp to help mix audio.
      5. MediaStream::name is now used as key for the streams_ map, so it must
      be constant, filter names are no longer hardcoded in the recorder.
      6. fromPeer parameter is determined by checking if MediaStream::name
      contains the string "remote".
      7. Adds copy constructor to MediaStream.
      8. Renames incrementStreams to incrementExpectedStreams to better reflect
      what it does.
      9. Removes keyframe triggers when starting a video record; we are
      recording raw frames, so it doesn't matter if they're keyframes or not.
      10. MediaRecorder supports more than 2 audio streams, but not video.
      11. Move preview to very bottom right corner.
      12. Fix potential Unchecked Return Value to NULL Pointer Dereference in
      recordData() (CWE-690).
      
      Gitlab: #39
      
      Change-Id: Id2fae4e9bb2072994c065e4843cc3ad832f89efc
      f1088fa8
  10. 15 Aug, 2018 2 commits
    • Hugo Lefeuvre's avatar
      audio_rtp_session: code cleanup · 27166567
      Hugo Lefeuvre authored
      Use const std::chrono::milliseconds type for secondsPerPaket_
      instead of defining seconds =
      std::chrono::duration<double, std::ratio<1>>. That way we avoid some
      useless casts later.
      
      Change type of sent_samples to uint64_t: unsigned is kind of small for
      this usage and getNextTimestamps expects seq of type uint64_t.
      
      Simplify code in readFunction() and process().
      
      Change-Id: I6ac7fd1b4553cfe5982a3d05a6467b8085f758a4
      Reviewed-by: Philippe Gorley's avatarPhilippe Gorley <philippe.gorley@savoirfairelinux.com>
      27166567
    • Hugo Lefeuvre's avatar
      threadloop: remove EXIT_IF_FAIL macro · f5257847
      Hugo Lefeuvre authored
      EXIT_IF_FAIL was meant to replace
      
      if (!(A)) {
          RING_ERR(__VA_ARGS__);
          loop_.exit();
      }
      
      but it is not very readable. Also, loop_.exit() throws an exception
      where setup functions calling EXIT_IF_FAIL could simply return
      false. Throwing an exception has a higher overhead and leads to less
      readable debug output (+ throwing exceptions should never be the
      standard way to exit the normal control flow).
      
      This patch
      - removes the EXIT_IF_FAIL macro
      - replaces code from audio_rtp_session and video_receive_thread which
        was using this macro
      - Adds stop() call at the end of ThreadLoop::mainloop. At this point
        the thread loop is obviously not executing anymore.
      
      Change-Id: Id1ed8eb914e91686a63775eba3ad70f8b6143ae5
      Reviewed-by: Philippe Gorley's avatarPhilippe Gorley <philippe.gorley@savoirfairelinux.com>
      f5257847
  11. 14 Aug, 2018 1 commit
  12. 08 Aug, 2018 1 commit
    • Philippe Gorley's avatar
      audio: refactor resampler class · 20b631fb
      Philippe Gorley authored
      Using MediaFilter would make the resampling time longer and more
      unpredictable than directly using libswresample.
      
      Adds libswresample as a dependency.
      Simplifies Resampler class.
      Resampler detects changes in input and output formats automatically.
      Changes Audiofile to use Resampler instead of MediaFilter.
      
      Change-Id: I24919e8fa514dbb4a38408e338016976e7424136
      20b631fb
  13. 30 Jul, 2018 1 commit
  14. 27 Jul, 2018 1 commit
    • Philippe Gorley's avatar
      audiobuffer: add conversion to AVFrame · e6ed1e1f
      Philippe Gorley authored
      Moves the AudioBuffer to AVFrame conversion logic outside of the
      MediaEncoder, so the latter only deals with AVFrame.
      
      Does not copy the buffer, the resulting AVFrame will simply point to the
      existing buffer.
      
      This is the first in a series of patches attempting to rid Ring of its
      RingBuffer/RingBufferPool system.
      
      Change-Id: I17c9fcdb96dc945c3eeace647303339d558bcf38
      Reviewed-by: Adrien Béraud's avatarAdrien Béraud <adrien.beraud@savoirfairelinux.com>
      e6ed1e1f
  15. 18 Jul, 2018 1 commit
  16. 12 Jul, 2018 1 commit
    • Philippe Gorley's avatar
      recorder: refactor pipeline · 11585ed2
      Philippe Gorley authored
      Moves the recorder up one level to the VideoInput, VideoReceiveThread
      and AudioReceiveThread, instead of the MediaDecoder (there's no
      equivalent to the VideoInput in the audio layer).
      
      Emits the RecordPlaybackStopped when the recording is stopped, so the
      client can sync its recording state with the daemon, in case the daemon
      stops recording by itself (rather than user intervention).
      
      Change-Id: I743b080cb354273ec074fec51caf2a4328fc1c58
      11585ed2
  17. 10 Jul, 2018 1 commit
  18. 06 Jun, 2018 1 commit
    • Philippe Gorley's avatar
      media: add video recording support · c21c5b77
      Philippe Gorley authored
      If there are 2 video streams, overlays local video over peer video. Peer
      video will be upscaled if it is too small, while local video will be
      scaled to 1/16th the size of the peer video.
      
      If there is only 1 video stream, uses peer video settings if they are
      valid, or fall back on local video settings.
      
      Adds title and description metadata to recorded file.
      
      Change-Id: I182de013e3ac2d18161eadf406fc6494e5f59a4e
      c21c5b77
  19. 29 May, 2018 1 commit
  20. 15 May, 2018 1 commit
  21. 24 Apr, 2018 1 commit
  22. 19 Mar, 2018 1 commit
    • Philippe Gorley's avatar
      media: update ffmpeg io read callbacks · 78ed2663
      Philippe Gorley authored
      In newer versions, AVIOContext's read_packet cb no longer considers 0
      as being EOF. Changes the read callbacks for SDP and RTP to return
      AVERROR_EOF instead of 0.
      
      Change-Id: Ica5bdc95913b4475f1e954a1141700fc88638a59
      78ed2663
  23. 23 Jan, 2018 1 commit
  24. 15 Jan, 2018 1 commit
    • Philippe Gorley's avatar
      accel: refactor and speed up fallback · ecf3e901
      Philippe Gorley authored
      Falling back from hardware to software decoding requires only a
      reinitialization of the AVCodecContext. Hardware decoding failure is no
      longer bubbled up to the RTP session, which makes it much faster.
      
      Change-Id: I79fdfcfa41f822b3299d74ac654146789fcfd97b
      ecf3e901
  25. 22 Jun, 2017 1 commit
  26. 15 Feb, 2017 1 commit
    • Olivier SOLDANO's avatar
      Path MTU discovery implementation · 29ae5d8a
      Olivier SOLDANO authored
      This implementation uses gnutls dtls heartbeat API to test path MTU.
      heartbeat allowing messages with automated response in a datagram,
      the application is able to guess the MTU via a timeout in the heartbeat.
      (timeout on packet sent and no response, implies that the MTU is lower
      than the lost payload.)
      To minimize false positives (a response is lost for example), each attempt
      triggers one retry on the first timeout.
      This version ensures a minimal MTU of 512 bytes will be returned in
      case of any failure in the procedure.
      For retrocompatibility with non heartbeat capable clients,
      a fallback MTU is set at 1280.
      
      Change-Id: Ib9a7f63a70e8bdad239d8fc103779a0f2c387e87
      Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
      29ae5d8a
  27. 05 Jan, 2017 1 commit
  28. 09 Dec, 2016 1 commit
    • atraczyk's avatar
      audio: fix unmuting of audio after audio has been muted · 168253ed
      atraczyk authored
      Saves the previous mute state in AudioRtpSession and AudioSender,
      so that when the audio encoder is re-instantiated, it can be set
      to a previously set state (if any).
      
      Change-Id: I25809499fd5afca1b6ae0f03c685a10ba95f94ac
      Tuleap: #1298
      168253ed
  29. 07 Oct, 2016 1 commit
  30. 19 Aug, 2016 1 commit
    • Gasuleg's avatar
      daemon: add SmartInfo · 0dc32710
      Gasuleg authored
      This feature provides relevant advanced information during a call.
      A user starts it with a refresh time and listens on a callback signal
      to get the updated information. This information is presented in a form
      of a map containing Call ID, codecs, framerate and resolution.
      
      The public API has:
      - startSmartInfo(<timeMS>)
      - stopSmartInfo()
      - CallSignal::SmartInfo(map) -- callback signal
      
      Change-Id: Iaafc12b5b53aee8ad008b93536f72a4152c4ee02
      Reviewed-by: Guillaume Roguez's avatarGuillaume Roguez <guillaume.roguez@savoirfairelinux.com>
      0dc32710
  31. 09 Mar, 2016 1 commit
  32. 20 Oct, 2015 1 commit
    • Guillaume Roguez's avatar
      rtp: fix RtpSession::restartSender() · 761d38e6
      Guillaume Roguez authored
      Calling this API causes a race condition with RtpSession::start().
      The former needs the latter to be run first, this was not enforced,
      causing a crash by nullptr access on socketPair_ member.
      This patch checks for a non-nullptr socketPair_ to procceed the restart.
      
      Issue: #81987
      Change-Id: I20886fe70398f018621aade1c7bac3ff15ef9055
      761d38e6
  33. 13 Oct, 2015 1 commit
    • Guillaume Roguez's avatar
      media_encoder: disable sdp related logging · 57bc2d33
      Guillaume Roguez authored
      - refactored media_encoder::print_sdp(): log result only if DEBUG_SDP build variable is defined
      - video_sender: remove sdp_ variable seems not to be used anywhere
      
      Issue: #81581
      Change-Id: I191e520d2ff81907adf9db90dfdf96616d3c50d4
      57bc2d33
  34. 21 Sep, 2015 1 commit
    • Guillaume Roguez's avatar
      update Copyright header · 5236ab05
      Guillaume Roguez authored
      - remove OpenSSL exception
      - fix Savoir-faire Linux naming
      - fix common Author: representation
      
      Issue: #80663
      Change-Id: I6c3b2ca1ed48ed474a0ecd5a30fe793526e11b00
      5236ab05
  35. 04 Sep, 2015 1 commit