Skip to content

Commit 203741e

Browse files
authored
Adjust to Agora SDK v4 (#15)
1 parent d72089d commit 203741e

11 files changed

+33
-25
lines changed

.circleci/config.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@ workflows:
77
build:
88
jobs:
99
- elixir/build_test:
10-
# post-steps: # steps to run after steps defined in the job bar
11-
# - elixir/use_build_cache:
12-
# cache-version: 3
13-
# env: test
14-
# regenerate: true
15-
# before-save:
16-
# - run: mix compile --force --warnings-as-errors
1710
filters: &filters
1811
tags:
1912
only: /v.*/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ docker run -it membraneframeworklabs/docker_membrane
2020

2121
To use that plugin in your project, add the following line to your deps in `mix.exs`:
2222
```
23-
{:membrane_agora_plugin, "~> 0.2.5"}
23+
{:membrane_agora_plugin, "~> 0.3.0"}
2424
```
2525

2626
Run `mix deps.get`.

c_src/membrane_agora_plugin/source/sample_audio_frame_observer.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,14 @@ class SampleAudioFrameObserver : public media::IAudioFrameObserverBase {
2424
bool onPlaybackAudioFrameBeforeMixing(const char *channelId,
2525
media::base::user_id_t uid,
2626
AudioFrame &audioFrame) override;
27+
28+
int getObservedAudioFramePosition() override {return 0;};
29+
30+
AudioParams getPlaybackAudioParams() override {return AudioParams();};
31+
32+
AudioParams getRecordAudioParams() override {return AudioParams();};
33+
34+
AudioParams getMixedAudioParams() override {return AudioParams();};
35+
36+
AudioParams getEarMonitoringAudioParams() override {return AudioParams();};
2737
};

c_src/membrane_agora_plugin/source/sample_local_user_observer.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
void SampleLocalUserObserver::onAudioTrackPublishSuccess(
44
agora_refptr<ILocalAudioTrack> audioTrack) {}
5-
void SampleLocalUserObserver::onLocalAudioTrackStateChanged(
6-
agora_refptr<ILocalAudioTrack> audioTrack, LOCAL_AUDIO_STREAM_STATE state,
7-
LOCAL_AUDIO_STREAM_ERROR errorCode) {}
85
void SampleLocalUserObserver::onLocalAudioTrackStatistics(
96
const LocalAudioStats &stats) {}
107
void SampleLocalUserObserver::onRemoteAudioTrackStatistics(
@@ -69,3 +66,8 @@ void SampleLocalUserObserver::onFirstRemoteVideoFrame(user_id_t userId,
6966
void SampleLocalUserObserver::onUserVideoTrackSubscribed(
7067
user_id_t userId, VideoTrackInfo trackInfo,
7168
agora_refptr<IRemoteVideoTrack> videoTrack) {}
69+
70+
void SampleLocalUserObserver::onVideoTrackUnpublished(agora_refptr<ILocalVideoTrack> videoTrack) {}
71+
void SampleLocalUserObserver::onVideoTrackPublishStart(agora_refptr<ILocalVideoTrack> videoTrack) {}
72+
void SampleLocalUserObserver::onAudioTrackUnpublished(agora_refptr<ILocalAudioTrack> audioTrack) {}
73+
void SampleLocalUserObserver::onAudioTrackPublishStart(agora_refptr<ILocalAudioTrack> audioTrack) {}

c_src/membrane_agora_plugin/source/sample_local_user_observer.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ class SampleLocalUserObserver : public ILocalUserObserver {
1212
~SampleLocalUserObserver() {}
1313
void onAudioTrackPublishSuccess(
1414
agora_refptr<ILocalAudioTrack> audioTrack) override;
15-
void
16-
onLocalAudioTrackStateChanged(agora_refptr<ILocalAudioTrack> audioTrack,
17-
LOCAL_AUDIO_STREAM_STATE state,
18-
LOCAL_AUDIO_STREAM_ERROR errorCode) override;
1915
void onLocalAudioTrackStatistics(const LocalAudioStats &stats) override;
2016
void
2117
onRemoteAudioTrackStatistics(agora_refptr<IRemoteAudioTrack> audioTrack,
@@ -81,4 +77,9 @@ class SampleLocalUserObserver : public ILocalUserObserver {
8177
void onUserVideoTrackSubscribed(
8278
user_id_t userId, VideoTrackInfo trackInfo,
8379
agora_refptr<IRemoteVideoTrack> videoTrack) override;
80+
81+
void onVideoTrackUnpublished(agora_refptr<ILocalVideoTrack> videoTrack) override;
82+
void onVideoTrackPublishStart(agora_refptr<ILocalVideoTrack> videoTrack) override;
83+
void onAudioTrackUnpublished(agora_refptr<ILocalAudioTrack> audioTrack) override;
84+
void onAudioTrackPublishStart(agora_refptr<ILocalAudioTrack> audioTrack) override;
8485
};

c_src/membrane_agora_plugin/source/sample_video_encoded_frame_observer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <unifex/payload.h>
44
#include <unifex/unifex.h>
55

6-
bool SampleVideoEncodedFrameObserver::OnEncodedVideoFrame(
6+
bool SampleVideoEncodedFrameObserver::onEncodedVideoFrameReceived(
77
uid_t uid, const uint8_t *imageBuffer, size_t length,
88
const EncodedVideoFrameInfo &videoEncodedFrameInfo) {
99
UnifexEnv *env = unifex_alloc_env(NULL);

c_src/membrane_agora_plugin/source/sample_video_encoded_frame_observer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class SampleVideoEncodedFrameObserver
1515
SampleVideoEncodedFrameObserver(UnifexPid destination)
1616
: _destination(destination) {}
1717

18-
bool OnEncodedVideoFrame(
18+
bool onEncodedVideoFrameReceived(
1919
uid_t uid, const uint8_t *imageBuffer, size_t length,
2020
const EncodedVideoFrameInfo &videoEncodedFrameInfo) override;
2121
};

install.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#! /bin/bash
22
if ! test -d ./agora_sdk; then
3-
wget https://download.agora.io/sdk/release/Agora-RTC-x86_64-linux-gnu-v3.8.202.20-20220627_152601-214165.tgz
4-
tar xvf Agora-RTC-x86_64-linux-gnu-v3.8.202.20-20220627_152601-214165.tgz
5-
rm Agora-RTC-x86_64-linux-gnu-v3.8.202.20-20220627_152601-214165.tgz
3+
wget https://download.agora.io/rtsasdk/release/Agora-RTC-x86_64-linux-gnu-v4.2.30-20240202_172130-292462.tgz
4+
tar xvf Agora-RTC-x86_64-linux-gnu-v4.2.30-20240202_172130-292462.tgz
5+
rm Agora-RTC-x86_64-linux-gnu-v4.2.30-20240202_172130-292462.tgz
66
mv agora_rtc_sdk/agora_sdk .
77
rm -r agora_rtc_sdk
8-
fi
8+
fi

mix.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Membrane.Agora.Mixfile do
22
use Mix.Project
33

4-
@version "0.2.5"
4+
@version "0.3.0"
55
@github_url "https://github.com/membraneframework/membrane_agora_plugin"
66

77
def project do
@@ -44,7 +44,7 @@ defmodule Membrane.Agora.Mixfile do
4444
{:membrane_raw_audio_format, "~> 0.12.0"},
4545
{:unifex, "~> 1.1"},
4646
{:membrane_file_plugin, "~> 0.16.0", only: :test},
47-
{:membrane_h264_plugin, "~> 0.9.0", only: :test},
47+
{:membrane_h26x_plugin, "~> 0.10.0", only: :test},
4848
{:membrane_aac_plugin, "~> 0.18.1", only: :test},
4949
{:membrane_realtimer_plugin, "~> 0.9.0", only: :test},
5050
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},

mix.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"membrane_core": {:hex, :membrane_core, "1.1.2", "3ca206893e1d3739a24d5092d21c06fcb4db326733a1798f9788fc53abb74829", [:mix], [{:bunch, "~> 1.6", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.3", [hex: :qex, repo: "hexpm", optional: false]}, {:ratio, "~> 3.0 or ~> 4.0", [hex: :ratio, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a989fd7e0516a7e66f5fb63950b1027315b7f8c8d82d8d685e178b0fb780901b"},
2424
"membrane_file_plugin": {:hex, :membrane_file_plugin, "0.16.0", "7917f6682c22b9bcfc2ca20ed960eee0f7d03ad31fd5f59ed850f1fe3ddd545a", [:mix], [{:membrane_core, "~> 1.0", [hex: :membrane_core, repo: "hexpm", optional: false]}], "hexpm", "b0727998f75a9b4dab8a2baefdfc13c3eac00a04e061ab1b0e61dc5566927acc"},
2525
"membrane_h264_format": {:hex, :membrane_h264_format, "0.6.1", "44836cd9de0abe989b146df1e114507787efc0cf0da2368f17a10c47b4e0738c", [:mix], [], "hexpm", "4b79be56465a876d2eac2c3af99e115374bbdc03eb1dea4f696ee9a8033cd4b0"},
26-
"membrane_h264_plugin": {:hex, :membrane_h264_plugin, "0.9.3", "5b9407c5eaff97b04667778e62f5f851011aeea2494fa2d14fc2448109babe7a", [:mix], [{:bunch, "~> 1.4", [hex: :bunch, repo: "hexpm", optional: false]}, {:membrane_core, "~> 1.0", [hex: :membrane_core, repo: "hexpm", optional: false]}, {:membrane_h264_format, "~> 0.6.0", [hex: :membrane_h264_format, repo: "hexpm", optional: false]}], "hexpm", "588e2e36051bc14d9a1e47dc6272fdccd6d24a7307fe7b4e417aa66afa962994"},
26+
"membrane_h265_format": {:hex, :membrane_h265_format, "0.2.0", "1903c072cf7b0980c4d0c117ab61a2cd33e88782b696290de29570a7fab34819", [:mix], [], "hexpm", "6df418bdf242c0d9f7dbf2e5aea4c2d182e34ac9ad5a8b8cef2610c290002e83"},
27+
"membrane_h26x_plugin": {:hex, :membrane_h26x_plugin, "0.10.2", "caf2790d8c107df35f8d456b45f4e09fb9c56ce6c7669a3a03f7d59972e6ed82", [:mix], [{:bunch, "~> 1.4", [hex: :bunch, repo: "hexpm", optional: false]}, {:membrane_core, "~> 1.0", [hex: :membrane_core, repo: "hexpm", optional: false]}, {:membrane_h264_format, "~> 0.6.0", [hex: :membrane_h264_format, repo: "hexpm", optional: false]}, {:membrane_h265_format, "~> 0.2.0", [hex: :membrane_h265_format, repo: "hexpm", optional: false]}], "hexpm", "becf1ac4a589adecd850137ccd61a33058f686083a514a7e39fcd721bcf9fb2e"},
2728
"membrane_raw_audio_format": {:hex, :membrane_raw_audio_format, "0.12.0", "b574cd90f69ce2a8b6201b0ccf0826ca28b0fbc8245b8078d9f11cef65f7d5d5", [:mix], [{:bimap, "~> 1.1", [hex: :bimap, repo: "hexpm", optional: false]}, {:bunch, "~> 1.0", [hex: :bunch, repo: "hexpm", optional: false]}, {:membrane_core, "~> 1.0", [hex: :membrane_core, repo: "hexpm", optional: false]}], "hexpm", "6e6c98e3622a2b9df19eab50ba65d7eb45949b1ba306fa8423df6cdb12fd0b44"},
2829
"membrane_realtimer_plugin": {:hex, :membrane_realtimer_plugin, "0.9.0", "27210d5e32a5e8bfd101c41e4d8c1876e873a52cc129ebfbee4d0ccbea1cbd21", [:mix], [{:membrane_core, "~> 1.0", [hex: :membrane_core, repo: "hexpm", optional: false]}], "hexpm", "b2e96d62135ee57ef9a5fdea94b3a9ab1198e5ea8ee248391b89c671125d1b51"},
2930
"mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [:mix], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"},

test/integration_test.exs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ defmodule Membrane.Agora.IntegrationTest do
5353
end
5454

5555
defp get_h264_frames(path) do
56-
alias Membrane.H264.Parser.{AUSplitter, NALuParser, NALuSplitter}
56+
alias Membrane.H264.{AUSplitter, NALuParser}
57+
alias Membrane.H26x.NALuSplitter
5758
bytestream = File.read!(path)
5859

5960
nalu_splitter = NALuSplitter.new()

0 commit comments

Comments
 (0)