Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change to FFmpeg v5.0
Browse files Browse the repository at this point in the history
bear101 committed Oct 31, 2024
1 parent 578aeea commit 1f5b287
Showing 8 changed files with 129 additions and 83 deletions.
7 changes: 3 additions & 4 deletions Library/TeamTalkLib/avstream/AVFVideoInput.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2005-2018, BearWare.dk
*
*
* Contact Information:
*
* Bjoern D. Rasmussen
@@ -32,7 +32,7 @@ extern "C" {

using namespace vidcap;

bool AVFVideoInput::SetupInput(AVInputFormat *iformat,
bool AVFVideoInput::SetupInput(const AVInputFormat *iformat,
AVDictionary *options,
AVFormatContext*& fmt_ctx,
AVCodecContext*& aud_dec_ctx,
@@ -42,7 +42,7 @@ bool AVFVideoInput::SetupInput(AVInputFormat *iformat,
{

auto vidfmt = GetMediaOutput().video;

iformat = av_find_input_format(m_dev.api.c_str());
int fps = 1;
if (vidfmt.fps_denominator)
@@ -67,4 +67,3 @@ bool AVFVideoInput::SetupInput(AVInputFormat *iformat,
audio_stream_index,
video_stream_index);
}

6 changes: 3 additions & 3 deletions Library/TeamTalkLib/avstream/AVFVideoInput.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2005-2018, BearWare.dk
*
*
* Contact Information:
*
* Bjoern D. Rasmussen
@@ -32,9 +32,9 @@ namespace vidcap {
const media::VideoFormat& fmt)
: FFmpegVideoInput(viddevice, fmt) {
}

// FFmpegStreamer override
bool SetupInput(struct AVInputFormat *iformat,
bool SetupInput(const struct AVInputFormat *iformat,
struct AVDictionary *options,
struct AVFormatContext*& fmt_ctx,
struct AVCodecContext*& aud_dec_ctx,
9 changes: 4 additions & 5 deletions Library/TeamTalkLib/avstream/FFmpegCapture.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2005-2018, BearWare.dk
*
*
* Contact Information:
*
* Bjoern D. Rasmussen
@@ -55,15 +55,15 @@ namespace vidcap {
const media::VideoFormat& fmt) = 0;
ffmpegvideoinput_t m_videoinput;
VideoCaptureCallback m_callback;

public:
FFmpegCapture();
virtual ~FFmpegCapture();

// VideoCapture interface
bool InitVideoCapture(const ACE_TString& deviceid,
const media::VideoFormat& vidfmt);

bool StartVideoCapture();

void StopVideoCapture();
@@ -72,7 +72,7 @@ namespace vidcap {

bool RegisterVideoFormat(VideoCaptureCallback callback, media::FourCC fcc);
void UnregisterVideoFormat(media::FourCC fcc);

// MediaStreamListener interface
bool MediaStreamVideoCallback(media::VideoFrame& video_frame,
ACE_Message_Block* mb_video);
@@ -84,4 +84,3 @@ namespace vidcap {
}

#endif

153 changes: 101 additions & 52 deletions Library/TeamTalkLib/avstream/FFmpegStreamer.cpp

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Library/TeamTalkLib/avstream/FFmpegStreamer.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2005-2018, BearWare.dk
*
*
* Contact Information:
*
* Bjoern D. Rasmussen
@@ -43,11 +43,11 @@ class FFmpegStreamer : public MediaFileStreamer
public:
FFmpegStreamer(const ACE_TString& filename, const MediaStreamOutput& out_prop);
virtual ~FFmpegStreamer();

virtual bool IsSystemTime() const { return false; }

protected:
virtual bool SetupInput(struct AVInputFormat *iformat,
virtual bool SetupInput(const struct AVInputFormat *iformat,
struct AVDictionary *options,
struct AVFormatContext*& fmt_ctx,
struct AVCodecContext*& aud_dec_ctx,
@@ -71,7 +71,7 @@ class FFmpegStreamer : public MediaFileStreamer
};

bool OpenInput(const ACE_TString& filename,
AVInputFormat *iformat,
const AVInputFormat *iformat,
AVDictionary *options,
AVFormatContext*& fmt_ctx,
AVCodecContext*& aud_dec_ctx,
4 changes: 2 additions & 2 deletions Library/TeamTalkLib/avstream/V4L2Capture.cpp
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ class V4L2Input : public FFmpegVideoInput
: FFmpegVideoInput(viddevice, fmt) { }

// FFmpegStreamer override
bool SetupInput(AVInputFormat *iformat,
bool SetupInput(const AVInputFormat *iformat,
AVDictionary *options,
AVFormatContext*& fmt_ctx,
AVCodecContext*& aud_dec_ctx,
@@ -113,7 +113,7 @@ vidcap_devices_t V4L2Capture::GetDevices()
{
vidcap_devices_t devs;

AVInputFormat* in_fmt = av_input_video_device_next(NULL), *indev_fmt = NULL;
const AVInputFormat* in_fmt = av_input_video_device_next(NULL), *indev_fmt = NULL;
while(in_fmt) {
if (av_match_name("v4l2", in_fmt->name)) {
indev_fmt = in_fmt;
3 changes: 1 addition & 2 deletions Library/TeamTalkLib/avstream/V4L2Capture.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2005-2018, BearWare.dk
*
*
* Contact Information:
*
* Bjoern D. Rasmussen
@@ -45,4 +45,3 @@ namespace vidcap {
}

#endif

22 changes: 11 additions & 11 deletions Library/TeamTalkLib/build/ffmpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

ExternalProject_Add(ffmpeg-arm64-src
GIT_REPOSITORY https://github.com/FFmpeg/FFmpeg
GIT_TAG n4.3.8
GIT_TAG n5.0
GIT_SHALLOW TRUE
UPDATE_COMMAND ""
PREFIX ${TOOLCHAIN_BUILD_PREFIX}/ffmpeg-arm64
@@ -41,9 +41,9 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
--disable-optimizations
--disable-stripping
--enable-debug=3
--extra-cflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}\ -arch\ arm64
--extra-cxxflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}\ -arch\ arm64
--extra-ldexeflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}\ -arch\ arm64
--extra-cflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}
--extra-cxxflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}
--extra-ldexeflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}
--pkg-config-flags=--static
--enable-cross-compile --target-os=darwin --arch=arm64
BUILD_COMMAND make ${TOOLCHAIN_BUILD_MAKEJOBS}
@@ -61,7 +61,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

ExternalProject_Add(ffmpeg-intel-src
GIT_REPOSITORY https://github.com/FFmpeg/FFmpeg
GIT_TAG n4.3.8
GIT_TAG n5.0
GIT_SHALLOW TRUE
UPDATE_COMMAND ""
PREFIX ${TOOLCHAIN_BUILD_PREFIX}/ffmpeg-intel
@@ -87,9 +87,9 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
--disable-optimizations
--disable-stripping
--enable-debug=3
--extra-cflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}\ -arch\ x86_64
--extra-cxxflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}\ -arch\ x86_64
--extra-ldexeflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}\ -arch\ x86_64
--extra-cflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}
--extra-cxxflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}
--extra-ldexeflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}
--pkg-config-flags=--static
--enable-cross-compile --target-os=darwin --arch=x86_64
BUILD_COMMAND make ${TOOLCHAIN_BUILD_MAKEJOBS}
@@ -270,7 +270,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "iOS")

ExternalProject_Add(ffmpeg-src
GIT_REPOSITORY https://github.com/FFmpeg/FFmpeg
GIT_TAG n4.3.8
GIT_TAG n5.0
GIT_SHALLOW TRUE
UPDATE_COMMAND ""
PREFIX ${TOOLCHAIN_BUILD_PREFIX}/ffmpeg
@@ -356,7 +356,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (TOOLCHAIN_BUILD_EXTERNALPROJECTS)
ExternalProject_Add(ffmpeg-src
GIT_REPOSITORY https://github.com/FFmpeg/FFmpeg
GIT_TAG n4.3.8
GIT_TAG n5.0
GIT_SHALLOW TRUE
UPDATE_COMMAND ""
PREFIX ${TOOLCHAIN_BUILD_PREFIX}/ffmpeg
@@ -513,7 +513,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Android")

ExternalProject_Add(ffmpeg-src
GIT_REPOSITORY https://github.com/FFmpeg/FFmpeg
GIT_TAG n4.3.8
GIT_TAG n5.0
GIT_SHALLOW TRUE
UPDATE_COMMAND ""
PREFIX ${TOOLCHAIN_BUILD_PREFIX}/ffmpeg

0 comments on commit 1f5b287

Please sign in to comment.