Skip to content

Commit

Permalink
undo everything fuck you ffmpeg 🖕🖕🖕🖕
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnut authored Nov 27, 2024
1 parent 563a3dd commit 14b58e6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 29 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ jobs:
- name: Windows
os: windows-latest

# - name: macOS
# os: macos-latest
- name: macOS
os: macos-latest

# - name: Android32
# os: ubuntu-latest
# target: Android32
# min-sdk: 24
- name: Android32
os: ubuntu-latest
target: Android32
min-sdk: 24

# - name: Android64
# os: ubuntu-latest
# target: Android64
- name: Android64
os: ubuntu-latest
target: Android64

name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
Expand Down
25 changes: 5 additions & 20 deletions src/recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,6 @@ bool Recorder::init(const RenderSettings& settings) {

m_init = true;

av_log_set_level(AV_LOG_DEBUG);

return true;
}

Expand Down Expand Up @@ -255,30 +253,17 @@ bool Recorder::writeFrame(const std::vector<uint8_t>& frameData) {
av_packet_unref(m_packet);
}

av_frame_free(&m_filteredFrame);

return true;
}

void Recorder::filterFrame(AVFrame* inputFrame, AVFrame* outputFrame) {
int ret = av_buffersrc_add_frame_flags(m_buffersrcCtx, inputFrame, 0);
if (ret < 0) {
char errbuf[AV_ERROR_MAX_STRING_SIZE];
av_strerror(ret, errbuf, AV_ERROR_MAX_STRING_SIZE);
if (av_buffersrc_add_frame(m_buffersrcCtx, inputFrame) < 0) {
std::cerr << "Error feeding frame to filter graph.\n";
avfilter_graph_free(&m_filterGraph);
geode::log::error("Error while feeding frame to filter graph: {}", errbuf);
return;
}

while(true) {
ret = av_buffersink_get_frame(m_buffersinkCtx, outputFrame);

outputFrame->time_base = av_buffersink_get_time_base(m_buffersinkCtx);

if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
break;
}
}
av_buffersink_get_frame(m_buffersinkCtx, outputFrame);
}

void Recorder::stop() {
Expand Down Expand Up @@ -307,10 +292,10 @@ void Recorder::stop() {

if(m_filterGraph) {
avfilter_graph_free(&m_filterGraph);
// av_frame_free(&m_filteredFrame);
av_frame_free(&m_filteredFrame);
}

delete m_packet;
}

}
}

0 comments on commit 14b58e6

Please sign in to comment.