资源简介

ffmpeg结合Windows SDK开发的点播功能,实现了ffmpeg的编解码功能,实现了网络传输功能,值得期待哦

资源截图

代码片段和文件信息

#include “internal.h“
#include “globals.h“
#include “wave_render.h“
#include “dsound_render.h“
#include “audio_out.h“


#ifdef  __cplusplus
extern “C“ {
#endif

EXPORT_API int wave_init_audio(struct ao_context *ctx uint32_t channels
uint32_t bits_per_sample uint32_t sample_rate int format)
{
wave_render* wave = NULL;
ctx->priv = (void*)(wave = new wave_render);
return wave->init_audio((void*)ctx->priv channels bits_per_sample sample_rate format) ? 0 : -1;
}

EXPORT_API int wave_play_audio(struct ao_context *ctx uint8_t* data uint32_t size)
{
wave_render* wave = (wave_render*)ctx->priv;
return wave->play_audio(data size);
}

EXPORT_API void wave_audio_control(struct ao_context *ctx double l double r)
{
wave_render* wave = (wave_render*)ctx->priv;
control_vol_t ctrl_vol = { l r };
wave->audio_control(CONTROL_SET_VOLUME &ctrl_vol);
}

EXPORT_API void wave_mute_set(struct ao_context *ctx int s)
{
wave_render* wave = (wave_render*)ctx->priv;
control_vol_t ctrl_vol;
ctrl_vol.mute = s;
wave->audio_control(CONTROL_MUTE_SET &ctrl_vol);
}

EXPORT_API void wave_destory_audio(struct ao_context *ctx)
{
wave_render* wave = (wave_render*)ctx->priv;
if (wave)
{
wave->destory_audio();
delete wave;
ctx->priv = NULL;
}
}


EXPORT_API int dsound_init_audio(struct ao_context *ctx uint32_t channels
uint32_t bits_per_sample uint32_t sample_rate int format)
{
dsound_render* dsound = NULL;
ctx->priv = (void*)(dsound = new dsound_render);
return dsound->init_audio((void*)dsound channels bits_per_sample sample_rate format) ? 0 : -1;
}

EXPORT_API int dsound_play_audio(struct ao_context *ctx uint8_t* data uint32_t size)
{
dsound_render* dsound = (dsound_render*)ctx->priv;
return dsound->play_audio(data size);
}

EXPORT_API void dsound_audio_control(struct ao_context *ctx double l double r)
{
dsound_render* dsound = (dsound_render*)ctx->priv;
control_vol_t ctrl_vol = { l r };
dsound->audio_control(CONTROL_SET_VOLUME &ctrl_vol);
}

EXPORT_API void dsound_mute_set(struct ao_context *ctx int s)
{
dsound_render* dsound = (dsound_render*)ctx->priv;
control_vol_t ctrl_vol;
ctrl_vol.mute = s;
dsound->audio_control(CONTROL_MUTE_SET &ctrl_vol);
}

EXPORT_API void dsound_destory_audio(struct ao_context *ctx)
{
dsound_render* dsound = (dsound_render*)ctx->priv;
if (dsound)
{
dsound->destory_audio();
delete dsound;
ctx->priv = NULL;
}
}

#ifdef  __cplusplus
}
#endif


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-05-02 12:00  avplayer-master\
     文件         533  2017-05-02 12:00  avplayer-master\.gitignore
     文件         104  2017-05-02 12:00  avplayer-master\.gitmodules
     文件         558  2017-05-02 12:00  avplayer-master\.travis.yml
     文件         976  2017-05-02 12:00  avplayer-master\CMakeLists.txt
     文件       35147  2017-05-02 12:00  avplayer-master\LICENSES
     文件        2481  2017-05-02 12:00  avplayer-master\README.md
     目录           0  2017-05-02 12:00  avplayer-master\audio\
     文件         138  2017-05-02 12:00  avplayer-master\audio\CMakeLists.txt
     文件        4599  2017-05-02 12:00  avplayer-master\audio\audio.vcproj
     文件        5897  2017-05-02 12:00  avplayer-master\audio\audio.vcxproj
     文件        1271  2017-05-02 12:00  avplayer-master\audio\audio.vcxproj.filters
     文件        2449  2017-05-02 12:00  avplayer-master\audio\audio_out.cpp
     文件        1693  2017-05-02 12:00  avplayer-master\audio\audio_out.h
     文件        4233  2017-05-02 12:00  avplayer-master\audio\audio_render.h
     文件       42114  2017-05-02 12:00  avplayer-master\audio\audiocvt.h
     文件       10402  2017-05-02 12:00  avplayer-master\audio\dsound_render.cpp
     文件        1510  2017-05-02 12:00  avplayer-master\audio\dsound_render.h
     文件         383  2017-05-02 12:00  avplayer-master\audio\internal.h
     文件        3728  2017-05-02 12:00  avplayer-master\audio\sdl_render.cpp
     文件        1602  2017-05-02 12:00  avplayer-master\audio\sdl_render.h
     文件        5753  2017-05-02 12:00  avplayer-master\audio\wave_render.cpp
     文件        1226  2017-05-02 12:00  avplayer-master\audio\wave_render.h
     文件        5589  2017-05-02 12:00  avplayer-master\avplay_vc2005.sln
     文件        3806  2017-05-02 12:00  avplayer-master\avplay_vc2012.sln
     文件          49  2017-05-02 12:00  avplayer-master\avplayer.kdev4
     目录           0  2017-05-02 12:00  avplayer-master\demux\
     文件        3626  2017-05-02 12:00  avplayer-master\demux\demux.cpp
     文件        1867  2017-05-02 12:00  avplayer-master\demux\demux.h
     文件        4670  2017-05-02 12:00  avplayer-master\demux\demux.vcproj
     文件        5666  2017-05-02 12:00  avplayer-master\demux\demux.vcxproj
............此处省略899个文件信息

评论

共有 条评论