Skip to content
Snippets Groups Projects
Commit db072646 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Adrien Béraud
Browse files

player: fix close player signature

Change-Id: I9f435dc52218222ccbfae1fb507f13a8cb71f6f7
parent 71b4d7a3
No related branches found
No related tags found
No related merge requests found
...@@ -570,9 +570,9 @@ pausePlayer(const std::string& id, bool pause) ...@@ -570,9 +570,9 @@ pausePlayer(const std::string& id, bool pause)
} }
bool bool
closePlayer(const std::string& id) closeMediaPlayer(const std::string& id)
{ {
return jami::closePlayer(id); return jami::closeMediaPlayer(id);
} }
bool bool
...@@ -758,7 +758,7 @@ pausePlayer(const std::string& id, bool pause) ...@@ -758,7 +758,7 @@ pausePlayer(const std::string& id, bool pause)
} }
bool bool
closePlayer(const std::string& id) closeMediaPlayer(const std::string& id)
{ {
return Manager::instance().getVideoManager().mediaPlayers.erase(id) > 0; return Manager::instance().getVideoManager().mediaPlayers.erase(id) > 0;
} }
......
...@@ -57,7 +57,8 @@ public: ...@@ -57,7 +57,8 @@ public:
std::map<std::string, std::weak_ptr<video::VideoInput>, std::less<>> videoInputs; std::map<std::string, std::weak_ptr<video::VideoInput>, std::less<>> videoInputs;
std::mutex audioMutex; std::mutex audioMutex;
bool hasRunningPlayers(); bool hasRunningPlayers();
std::shared_ptr<video::VideoInput> getVideoInput(std::string_view id) const { std::shared_ptr<video::VideoInput> getVideoInput(std::string_view id) const
{
auto input = videoInputs.find(id); auto input = videoInputs.find(id);
return input == videoInputs.end() ? nullptr : input->second.lock(); return input == videoInputs.end() ? nullptr : input->second.lock();
} }
...@@ -65,11 +66,12 @@ public: ...@@ -65,11 +66,12 @@ public:
video::VideoDeviceMonitor& getVideoDeviceMonitor(); video::VideoDeviceMonitor& getVideoDeviceMonitor();
std::shared_ptr<AudioInput> getAudioInput(const std::string& id); std::shared_ptr<AudioInput> getAudioInput(const std::string& id);
std::shared_ptr<video::VideoInput> getVideoInput(const std::string& id, video::VideoInputMode inputMode = video::VideoInputMode::Undefined); std::shared_ptr<video::VideoInput> getVideoInput(
const std::string& id, video::VideoInputMode inputMode = video::VideoInputMode::Undefined);
std::string createMediaPlayer(const std::string& path); std::string createMediaPlayer(const std::string& path);
std::shared_ptr<MediaPlayer> getMediaPlayer(const std::string& id); std::shared_ptr<MediaPlayer> getMediaPlayer(const std::string& id);
bool pausePlayer(const std::string& id, bool pause); bool pausePlayer(const std::string& id, bool pause);
bool closePlayer(const std::string& id); bool closeMediaPlayer(const std::string& id);
bool mutePlayerAudio(const std::string& id, bool mute); bool mutePlayerAudio(const std::string& id, bool mute);
bool playerSeekToTime(const std::string& id, int time); bool playerSeekToTime(const std::string& id, int time);
int64_t getPlayerPosition(const std::string& id); int64_t getPlayerPosition(const std::string& id);
......
...@@ -154,7 +154,6 @@ private: ...@@ -154,7 +154,6 @@ private:
void setGeometry(int format, int width, int height) noexcept; void setGeometry(int format, int width, int height) noexcept;
}; };
/* FrameBuffer is a generic video frame container */ /* FrameBuffer is a generic video frame container */
struct DRING_PUBLIC FrameBuffer struct DRING_PUBLIC FrameBuffer
{ {
...@@ -165,7 +164,9 @@ struct DRING_PUBLIC FrameBuffer ...@@ -165,7 +164,9 @@ struct DRING_PUBLIC FrameBuffer
int height {0}; // frame height int height {0}; // frame height
std::vector<uint8_t> storage; std::vector<uint8_t> storage;
// If set, new frame will be written to this buffer instead // If set, new frame will be written to this buffer instead
std::unique_ptr<AVFrame, void (*)(AVFrame*)> avframe {nullptr, [](AVFrame* frame) { av_frame_free(&frame); }}; std::unique_ptr<AVFrame, void (*)(AVFrame*)> avframe {nullptr, [](AVFrame* frame) {
av_frame_free(&frame);
}};
}; };
struct DRING_PUBLIC SinkTarget struct DRING_PUBLIC SinkTarget
...@@ -199,7 +200,7 @@ DRING_PUBLIC std::string openVideoInput(const std::string& path); ...@@ -199,7 +200,7 @@ DRING_PUBLIC std::string openVideoInput(const std::string& path);
DRING_PUBLIC bool closeVideoInput(const std::string& id); DRING_PUBLIC bool closeVideoInput(const std::string& id);
DRING_PUBLIC std::string createMediaPlayer(const std::string& path); DRING_PUBLIC std::string createMediaPlayer(const std::string& path);
DRING_PUBLIC std::string closeMediaPlayer(const std::string& id); DRING_PUBLIC bool closeMediaPlayer(const std::string& id);
DRING_PUBLIC bool pausePlayer(const std::string& id, bool pause); DRING_PUBLIC bool pausePlayer(const std::string& id, bool pause);
DRING_PUBLIC bool mutePlayerAudio(const std::string& id, bool mute); DRING_PUBLIC bool mutePlayerAudio(const std::string& id, bool mute);
DRING_PUBLIC bool playerSeekToTime(const std::string& id, int time); DRING_PUBLIC bool playerSeekToTime(const std::string& id, int time);
...@@ -209,13 +210,13 @@ DRING_PUBLIC void registerSinkTarget(const std::string& sinkId, const SinkTarget ...@@ -209,13 +210,13 @@ DRING_PUBLIC void registerSinkTarget(const std::string& sinkId, const SinkTarget
DRING_PUBLIC void registerAVSinkTarget(const std::string& sinkId, const AVSinkTarget& target); DRING_PUBLIC void registerAVSinkTarget(const std::string& sinkId, const AVSinkTarget& target);
DRING_PUBLIC std::map<std::string, std::string> getRenderer(const std::string& callId); DRING_PUBLIC std::map<std::string, std::string> getRenderer(const std::string& callId);
DRING_PUBLIC std::string startLocalMediaRecorder(const std::string& videoInputId, const std::string& filepath); DRING_PUBLIC std::string startLocalMediaRecorder(const std::string& videoInputId,
const std::string& filepath);
DRING_PUBLIC void stopLocalRecorder(const std::string& filepath); DRING_PUBLIC void stopLocalRecorder(const std::string& filepath);
#if defined(__ANDROID__) || defined(RING_UWP) || (defined(TARGET_OS_IOS) && TARGET_OS_IOS) #if defined(__ANDROID__) || defined(RING_UWP) || (defined(TARGET_OS_IOS) && TARGET_OS_IOS)
DRING_PUBLIC void addVideoDevice( DRING_PUBLIC void addVideoDevice(
const std::string& node, const std::string& node, const std::vector<std::map<std::string, std::string>>& devInfo = {});
const std::vector<std::map<std::string, std::string>>& devInfo = {});
DRING_PUBLIC void removeVideoDevice(const std::string& node); DRING_PUBLIC void removeVideoDevice(const std::string& node);
DRING_PUBLIC VideoFrame* getNewFrame(std::string_view id); DRING_PUBLIC VideoFrame* getNewFrame(std::string_view id);
DRING_PUBLIC void publishFrame(std::string_view id); DRING_PUBLIC void publishFrame(std::string_view id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment