| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824 |
- #include "playercontroller.h"
- #include "common.h"
- #include <QApplication>
- #include <QElapsedTimer>
- #include <QStatusBar>
- #include <cassert>
- #include <memory>
- #include "ffmpeg_init.h"
- #include "start_play_thread.h"
- #include "video_state.h"
- #include "audio_decode_thread.h"
- #include "audio_effect_helper.h"
- #include "audio_play_thread.h"
- #include "play_control_window.h"
- #include "read_thread.h"
- #include "start_play_thread.h"
- #include "stopplay_waiting_thread.h"
- #include "subtitle_decode_thread.h"
- #include "video_decode_thread.h"
- #include "video_play_thread.h"
- #include "video_state.h"
- PlayerController::PlayerController(QWidget* parent)
- : QObject(parent)
- {
- ffmpeg_init();
- connect(this,
- &PlayerController::asyncInitFinished,
- this,
- &PlayerController::onAsyncInitFinished);
- m_state = PlayerState::Idle;
- }
- PlayerController::~PlayerController()
- {
- if (m_initThread.joinable()) {
- m_initThread.join();
- }
- stopPlay();
- }
- void PlayerController::startToPlay(const QString& file)
- {
- std::lock_guard<std::mutex> lock(m_stopMutex);
- // 自愈:如果状态为Playing但所有线程都已退出,强制Idle
- if (m_state == PlayerState::Playing) {
- if (!m_packetReadThread && !m_decodeVideoThread && !m_decodeAudioThread &&
- !m_audioPlayThread && !m_videoPlayThread && !m_decodeSubtitleThread) {
- m_videoState.reset();
- m_currentFile.clear();
- m_state = PlayerState::Idle;
- qDebug() << "[PlayerController] All threads stopped, force reset to Idle.";
- }
- }
- if (m_state == PlayerState::Initializing) {
- qDebug() << "Player is initializing. Ignoring request.";
- return;
- }
- if (m_state == PlayerState::Playing) {
- if (m_currentFile == file) {
- qDebug() << "Already playing the same file. Ignoring request.";
- return;
- } else {
- qDebug() << "Player is busy with another file, stopping and switching to:" << file;
- stopPlay();
- // 这里直接 fallthrough 到 Idle 状态
- }
- }
- if (m_state == PlayerState::Idle) {
- qDebug() << "Player is idle. Starting playback for:" << file;
- m_state = PlayerState::Initializing;
- m_currentFile = file;
- if (m_initThread.joinable()) {
- m_initThread.join();
- }
- m_initThread = std::thread(&PlayerController::asyncInit, this, file);
- }
- }
- void PlayerController::asyncInit(const QString& file)
- {
- bool success = false;
- QElapsedTimer timer;
- timer.start();
- qDebug("[Init] asyncInit started");
- if (file.isEmpty()) {
- qWarning("Filename is invalid. Please select a valid media file.");
- success = false;
- } else {
- qInfo("Check file: %s", qUtf8Printable(toNativePath(file)));
- success = true;
- }
- m_initSuccess = success;
- emit asyncInitFinished(file, success);
- qDebug("[Init] asyncInit finished in %lld ms", timer.elapsed());
- }
- void PlayerController::onAsyncInitFinished(const QString& file, bool success)
- {
- std::lock_guard<std::mutex> lock(m_stopMutex);
- if (!success) {
- playFailed(m_currentFile);
- m_state = PlayerState::Idle;
- return;
- }
- qDebug("[Init] createReadThread...");
- if (!createReadThread()) {
- qWarning("Packet read thread creation failed");
- playFailed(m_currentFile);
- m_state = PlayerState::Idle;
- return;
- }
- qDebug("[Init] createVideoState...");
- if (!createVideoState(m_currentFile)) {
- qWarning("Video state creation failed");
- readPacketStopped();
- playFailed(m_currentFile);
- m_state = PlayerState::Idle;
- return;
- }
- assert(m_videoState);
- if (!m_videoState) {
- qWarning("Video state initialization error");
- playFailed(m_currentFile);
- m_state = PlayerState::Idle;
- return;
- }
- m_packetReadThread->set_video_state(m_videoState->get_state());
- const bool hasVideo = playingHasVideo();
- const bool hasAudio = playingHasAudio();
- const bool hasSubtitle = playingHasSubtitle();
- if (hasVideo) {
- if (!createDecodeVideoThread() || !createVideoPlayThread()) {
- qWarning("Video processing setup failed");
- playFailed(m_currentFile);
- stopPlay();
- m_state = PlayerState::Idle;
- return;
- }
- }
- if (hasAudio) {
- if (!createDecodeAudioThread() || !createAudioPlayThread()) {
- qWarning("Audio processing setup failed");
- playFailed(m_currentFile);
- stopPlay();
- m_state = PlayerState::Idle;
- return;
- }
- }
- if (hasSubtitle && !createDecodeSubtitleThread()) {
- qWarning("Subtitle processing setup failed");
- playFailed(m_currentFile);
- stopPlay();
- m_state = PlayerState::Idle;
- return;
- }
- if (hasAudio) {
- startPlayThread();
- } else {
- playStarted();
- }
- emit startToPlaySignal();
- m_state = PlayerState::Playing;
- }
- void PlayerController::stopPlay()
- {
- std::lock_guard<std::mutex> lock(m_stopMutex);
- if (m_state == PlayerState::Idle)
- return;
- m_state = PlayerState::Stopping;
- auto stopAndReset = [](auto& threadPtr) {
- if (threadPtr) {
- threadPtr->stop_thread();
- threadPtr->wait(3000); // 最多等3秒
- threadPtr.reset();
- }
- };
- stopAndReset(m_stopPlayWaitingThread);
- stopAndReset(m_beforePlayThread);
- stopAndReset(m_packetReadThread);
- stopAndReset(m_decodeVideoThread);
- stopAndReset(m_decodeAudioThread);
- stopAndReset(m_decodeSubtitleThread);
- stopAndReset(m_videoPlayThread);
- stopAndReset(m_audioPlayThread);
- m_videoState.reset();
- m_currentFile.clear();
- m_state = PlayerState::Idle;
- }
- void PlayerController::pausePlay()
- {
- if (!m_videoState)
- return;
- if (auto state = m_videoState->get_state())
- toggle_pause(state, !state->paused);
- emit updatePlayControlStatus();
- }
- void PlayerController::playMute(bool mute)
- {
- if (!m_videoState)
- return;
- if (auto state = m_videoState->get_state())
- toggle_mute(state, mute);
- }
- void PlayerController::playStartSeek()
- {
- emit playSeek();
- pausePlay();
- }
- void PlayerController::playSeekPre()
- {
- videoSeekInc(-2);
- }
- void PlayerController::playSeekNext()
- {
- videoSeekInc(2);
- }
- void PlayerController::setVolume(int volume, int maxValue)
- {
- if (!m_audioPlayThread)
- return;
- const float vol = static_cast<float>(volume) / maxValue;
- m_audioPlayThread->set_device_volume(vol);
- }
- void PlayerController::setPlaySpeed(double speed)
- {
- if (m_videoState) {
- if (auto state = m_videoState->get_state()) {
- #if USE_AVFILTER_AUDIO
- set_audio_playspeed(state, speed);
- #endif
- }
- }
- }
- // 状态访问接口
- QString PlayerController::playingFile() const
- {
- return isPlaying() ? m_currentFile : QString();
- }
- bool PlayerController::isPlaying() const
- {
- return m_state == PlayerState::Playing;
- }
- bool PlayerController::playingHasVideo()
- {
- return m_videoState ? m_videoState->has_video() : false;
- }
- bool PlayerController::playingHasAudio()
- {
- return m_videoState ? m_videoState->has_audio() : false;
- }
- bool PlayerController::playingHasSubtitle()
- {
- return m_videoState ? m_videoState->has_subtitle() : false;
- }
- VideoState* PlayerController::state()
- {
- return m_videoState ? m_videoState->get_state() : nullptr;
- }
- float PlayerController::deviceVolume() const
- {
- return m_audioPlayThread ? m_audioPlayThread->get_device_volume() : 0.0f;
- }
- void PlayerController::setDeviceVolume(float volume)
- {
- if (m_audioPlayThread)
- m_audioPlayThread->set_device_volume(volume);
- }
- // 播放状态回调槽函数
- void PlayerController::playStarted(bool success)
- {
- if (!success) {
- qWarning("Audio device initialization failed!");
- return;
- }
- allThreadStart();
- setThreads();
- }
- void PlayerController::playFailed(const QString& file)
- {
- emit showMessage(QString("Playback failed: %1").arg(toNativePath(file)), "Warning", "");
- }
- // 线程 finished 槽函数只做日志和信号
- void PlayerController::readPacketStopped()
- {
- qDebug("************* Read packets thread stopped signal received.");
- m_packetReadThread.reset();
- checkAndResetState();
- emit audioStopped();
- }
- void PlayerController::decodeVideoStopped()
- {
- qDebug("************* Video decode thread stopped.");
- m_decodeVideoThread.reset();
- checkAndResetState();
- }
- void PlayerController::decodeAudioStopped()
- {
- qDebug("************* Audio decode thread stopped.");
- m_decodeAudioThread.reset();
- checkAndResetState();
- }
- void PlayerController::decodeSubtitleStopped()
- {
- qDebug("************* Subtitle decode thread stopped.");
- m_decodeSubtitleThread.reset();
- checkAndResetState();
- }
- void PlayerController::audioPlayStopped()
- {
- qDebug("************* Audio play thread stopped.");
- emit audioStopped();
- m_audioPlayThread.reset();
- checkAndResetState();
- }
- void PlayerController::videoPlayStopped()
- {
- qDebug("************* Video play thread stopped.");
- emit videoStopped();
- m_videoPlayThread.reset();
- checkAndResetState();
- }
- // 线程管理槽函数
- void PlayerController::setThreads()
- {
- if (!m_videoState)
- return;
- Threads threads;
- threads.read_tid = m_packetReadThread.get();
- threads.video_decode_tid = m_decodeVideoThread.get();
- threads.audio_decode_tid = m_decodeAudioThread.get();
- threads.video_play_tid = m_videoPlayThread.get();
- threads.audio_play_tid = m_audioPlayThread.get();
- threads.subtitle_decode_tid = m_decodeSubtitleThread.get();
- m_videoState->threads_setting(m_videoState->get_state(), threads);
- }
- void PlayerController::startSendData(bool send)
- {
- if (m_audioPlayThread)
- m_audioPlayThread->send_visual_open(send);
- }
- void PlayerController::videoSeek(double position, double increment)
- {
- if (!m_videoState)
- return;
- auto state = m_videoState->get_state();
- if (!state)
- return;
- if (state->ic->start_time != AV_NOPTS_VALUE
- && position < state->ic->start_time / static_cast<double>(AV_TIME_BASE)) {
- position = state->ic->start_time / static_cast<double>(AV_TIME_BASE);
- }
- stream_seek(state,
- static_cast<int64_t>(position * AV_TIME_BASE),
- static_cast<int64_t>(increment * AV_TIME_BASE),
- 0);
- }
- // 核心私有实现
- bool PlayerController::startPlay()
- {
- QElapsedTimer timer;
- timer.start();
- if (m_currentFile.isEmpty()) {
- qWarning("Filename is invalid. Please select a valid media file.");
- return false;
- }
- qInfo("Starting playback: %s", qUtf8Printable(toNativePath(m_currentFile)));
- // 创建数据包读取线程
- if (!createReadThread()) {
- qWarning("Packet read thread creation failed");
- return false;
- }
- // 创建视频状态对象
- if (!createVideoState(m_currentFile)) {
- qWarning("Video state creation failed");
- readPacketStopped();
- return false;
- }
- // 检查状态有效性
- assert(m_videoState);
- if (!m_videoState) {
- qWarning("Video state initialization error");
- return false;
- }
- m_packetReadThread->set_video_state(m_videoState->get_state());
- const bool hasVideo = playingHasVideo();
- const bool hasAudio = playingHasAudio();
- const bool hasSubtitle = playingHasSubtitle();
- // 创建视频相关线程
- if (hasVideo) {
- if (!createDecodeVideoThread() || !createVideoPlayThread()) {
- qWarning("Video processing setup failed");
- return false;
- }
- }
- // 创建音频相关线程
- if (hasAudio) {
- if (!createDecodeAudioThread() || !createAudioPlayThread()) {
- qWarning("Audio processing setup failed");
- return false;
- }
- }
- // 创建字幕线程
- if (hasSubtitle && !createDecodeSubtitleThread()) {
- qWarning("Subtitle processing setup failed");
- return false;
- }
- // 开始播放
- if (hasAudio) {
- startPlayThread(); // 异步启动(处理音频设备初始化)
- } else {
- playStarted(); // 同步启动(无音频流)
- }
- qDebug("Playback initialized in %lld ms", timer.elapsed());
- return true;
- }
- void PlayerController::waitStopPlay(const QString& file)
- {
- m_stopPlayWaitingThread = std::make_unique<StopWaitingThread>(this, file);
- connect(m_stopPlayWaitingThread.get(),
- &StopWaitingThread::stopPlay,
- this,
- &PlayerController::stopPlay);
- connect(m_stopPlayWaitingThread.get(),
- &StopWaitingThread::startPlay,
- this,
- &PlayerController::startToPlay);
- m_stopPlayWaitingThread->start();
- qDebug("++++++++++ StopPlay waiting thread started");
- }
- void PlayerController::allThreadStart()
- {
- // 启动所有创建的线程
- if (m_packetReadThread) {
- m_packetReadThread->start();
- qDebug("++++++++++ Read packets thread started");
- }
- if (m_decodeVideoThread) {
- m_decodeVideoThread->start();
- qDebug("++++++++++ Video decode thread started");
- }
- if (m_decodeAudioThread) {
- m_decodeAudioThread->start(QThread::Priority::HighPriority);
- qDebug("++++++++++ Audio decode thread started");
- }
- if (m_decodeSubtitleThread) {
- m_decodeSubtitleThread->start();
- qDebug("++++++++++ Subtitle decode thread started");
- }
- if (m_videoPlayThread) {
- m_videoPlayThread->start();
- qDebug("++++++++++ Video play thread started");
- }
- if (m_audioPlayThread) {
- m_audioPlayThread->start();
- qDebug("++++++++++ Audio play thread started");
- }
- // 通知UI更新
- emit setPlayControlWnd(true);
- emit updatePlayControlVolume();
- emit updatePlayControlStatus();
- }
- // 辅助函数
- void PlayerController::videoSeekInc(double increment)
- {
- if (!m_videoState)
- return;
- auto state = m_videoState->get_state();
- if (!state)
- return;
- double position = get_master_clock(state);
- if (std::isnan(position)) {
- position = static_cast<double>(state->seek_pos) / AV_TIME_BASE;
- }
- position += increment;
- videoSeek(position, increment);
- }
- // 新增自愈机制辅助函数
- void PlayerController::checkAndResetState()
- {
- std::lock_guard<std::mutex> lock(m_stopMutex);
- if (!m_packetReadThread && !m_decodeVideoThread && !m_decodeAudioThread &&
- !m_audioPlayThread && !m_videoPlayThread && !m_decodeSubtitleThread) {
- m_videoState.reset();
- m_currentFile.clear();
- m_state = PlayerState::Idle;
- qDebug() << "[PlayerController] All threads stopped, state reset to Idle.";
- emit playbackFinished(); // 新增:通知UI
- } else {
- qDebug() << "[PlayerController] checkAndResetState: "
- << "m_packetReadThread:" << (bool)m_packetReadThread
- << "m_decodeVideoThread:" << (bool)m_decodeVideoThread
- << "m_decodeAudioThread:" << (bool)m_decodeAudioThread
- << "m_audioPlayThread:" << (bool)m_audioPlayThread
- << "m_videoPlayThread:" << (bool)m_videoPlayThread
- << "m_decodeSubtitleThread:" << (bool)m_decodeSubtitleThread;
- }
- }
- // 线程创建方法
- bool PlayerController::createVideoState(const QString& file)
- {
- const bool useHardware = false; // 待实现:来自UI设置
- const bool loop = false; // 待实现:来自UI设置
- if (m_videoState)
- return false;
- m_videoState = std::make_unique<VideoStateData>(useHardware, loop);
- const int ret = m_videoState->create_video_state(file.toUtf8().constData());
- if (ret < 0) {
- m_videoState.reset();
- qWarning("Video state creation failed (error: %d)", ret);
- return false;
- }
- return true;
- }
- void PlayerController::deleteVideoState()
- {
- m_videoState.reset();
- }
- bool PlayerController::createReadThread()
- {
- if (m_packetReadThread)
- return false;
- m_packetReadThread = std::make_unique<ReadThread>(this);
- connect(m_packetReadThread.get(),
- &ReadThread::finished,
- this,
- &PlayerController::readPacketStopped);
- return true;
- }
- bool PlayerController::createDecodeVideoThread()
- {
- if (!m_videoState || m_decodeVideoThread)
- return false;
- auto state = m_videoState->get_state();
- if (!state)
- return false;
- m_decodeVideoThread = std::make_unique<VideoDecodeThread>(this, state);
- connect(m_decodeVideoThread.get(),
- &VideoDecodeThread::finished,
- this,
- &PlayerController::decodeVideoStopped);
- auto codecContext = m_videoState->get_contex(AVMEDIA_TYPE_VIDEO);
- // 初始化视频解码器
- int ret = decoder_init(&state->viddec,
- codecContext,
- &state->videoq,
- state->continue_read_thread);
- if (ret < 0) {
- qWarning("Video decoder initialization failed (error: %d)", ret);
- return false;
- }
- ret = decoder_start(&state->viddec, m_decodeVideoThread.get(), "video_decoder");
- if (ret < 0) {
- qWarning("Video decoder start failed (error: %d)", ret);
- return false;
- }
- state->queue_attachments_req = 1;
- return true;
- }
- bool PlayerController::createDecodeAudioThread()
- {
- if (!m_videoState || m_decodeAudioThread)
- return false;
- auto state = m_videoState->get_state();
- if (!state)
- return false;
- m_decodeAudioThread = std::make_unique<AudioDecodeThread>(this, state);
- connect(m_decodeAudioThread.get(),
- &AudioDecodeThread::finished,
- this,
- &PlayerController::decodeAudioStopped);
- auto codecContext = m_videoState->get_contex(AVMEDIA_TYPE_AUDIO);
- // 初始化音频解码器
- int ret = decoder_init(&state->auddec,
- codecContext,
- &state->audioq,
- state->continue_read_thread);
- if (ret < 0) {
- qWarning("Audio decoder initialization failed (error: %d)", ret);
- return false;
- }
- ret = decoder_start(&state->auddec, m_decodeAudioThread.get(), "audio_decoder");
- if (ret < 0) {
- qWarning("Audio decoder start failed (error: %d)", ret);
- return false;
- }
- return true;
- }
- bool PlayerController::createDecodeSubtitleThread()
- {
- if (!m_videoState || m_decodeSubtitleThread)
- return false;
- auto state = m_videoState->get_state();
- if (!state)
- return false;
- m_decodeSubtitleThread = std::make_unique<SubtitleDecodeThread>(this, state);
- connect(m_decodeSubtitleThread.get(),
- &SubtitleDecodeThread::finished,
- this,
- &PlayerController::decodeSubtitleStopped);
- auto codecContext = m_videoState->get_contex(AVMEDIA_TYPE_SUBTITLE);
- // 初始化字幕解码器
- int ret = decoder_init(&state->subdec,
- codecContext,
- &state->subtitleq,
- state->continue_read_thread);
- if (ret < 0) {
- qWarning("Subtitle decoder initialization failed (error: %d)", ret);
- return false;
- }
- ret = decoder_start(&state->subdec, m_decodeSubtitleThread.get(), "subtitle_decoder");
- if (ret < 0) {
- qWarning("Subtitle decoder start failed (error: %d)", ret);
- return false;
- }
- return true;
- }
- bool PlayerController::createVideoPlayThread()
- {
- if (!m_videoState || m_videoPlayThread)
- return false;
- auto state = m_videoState->get_state();
- if (!state)
- return false;
- m_videoPlayThread = std::make_unique<VideoPlayThread>(this, state);
- // 连接信号
- connect(m_videoPlayThread.get(),
- &VideoPlayThread::finished,
- this,
- &PlayerController::videoPlayStopped);
- connect(m_videoPlayThread.get(),
- &VideoPlayThread::frameReady,
- this,
- &PlayerController::frameReady);
- connect(m_videoPlayThread.get(),
- &VideoPlayThread::subtitle_ready,
- this,
- &PlayerController::subtitleReady);
- connect(this,
- &PlayerController::stopVideoPlayThread,
- m_videoPlayThread.get(),
- &VideoPlayThread::stop_thread);
- // 初始化参数
- auto videoContext = m_videoState->get_contex(AVMEDIA_TYPE_VIDEO);
- const bool useHardware = m_videoState->is_hardware_decode();
- if (!m_videoPlayThread->init_resample_param(videoContext, useHardware)) {
- qWarning("Video resample parameters initialization failed");
- return false;
- }
- return true;
- }
- bool PlayerController::createAudioPlayThread()
- {
- if (!m_videoState || m_audioPlayThread)
- return false;
- auto state = m_videoState->get_state();
- if (!state)
- return false;
- m_audioPlayThread = std::make_unique<AudioPlayThread>(this, state);
- // 连接信号
- connect(m_audioPlayThread.get(),
- &AudioPlayThread::finished,
- this,
- &PlayerController::audioPlayStopped);
- connect(this,
- &PlayerController::stopAudioPlayThread,
- m_audioPlayThread.get(),
- &AudioPlayThread::stop_thread);
- connect(m_audioPlayThread.get(),
- &AudioPlayThread::update_play_time,
- this,
- &PlayerController::updatePlayTime);
- connect(m_audioPlayThread.get(),
- &AudioPlayThread::data_visual_ready,
- this,
- &PlayerController::audioData);
- // 音频设备初始化在独立线程中完成
- return true;
- }
- bool PlayerController::startPlayThread()
- {
- if (m_beforePlayThread)
- return false;
- m_beforePlayThread = std::make_unique<StartPlayThread>(this, this);
- connect(m_beforePlayThread.get(),
- &StartPlayThread::audio_device_init,
- this,
- &PlayerController::playStarted);
- m_beforePlayThread->start();
- qDebug("++++++++++ StartPlay thread (audio init) started");
- return true;
- }
- // 调试辅助函数
- void PlayerController::printDecodeContext(const AVCodecContext* codecCtx, bool isVideo) const
- {
- if (!codecCtx)
- return;
- qInfo("%s codec: %s", isVideo ? "Video" : "Audio", codecCtx->codec->name);
- qInfo(" Type: %d, ID: %d, Tag: %d",
- codecCtx->codec_type,
- codecCtx->codec_id,
- codecCtx->codec_tag);
- if (isVideo) {
- qInfo(" Dimensions: %dx%d", codecCtx->width, codecCtx->height);
- } else {
- qInfo(" Sample rate: %d Hz, Channels: %d, Format: %d",
- codecCtx->sample_rate,
- codecCtx->ch_layout.nb_channels,
- codecCtx->sample_fmt);
- qInfo(" Frame size: %d, Block align: %d", codecCtx->frame_size, codecCtx->block_align);
- }
- }
|