Skip to content

Commit

Permalink
commit first version
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Mar 28, 2012
1 parent f89c810 commit 1a17dc0
Show file tree
Hide file tree
Showing 233 changed files with 43,317 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.ncb
*.user
*.suo
*.torrent
12 changes: 9 additions & 3 deletions README
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
һֱ����, �ڶ�ý�岥�������, ��ʹĿǰ�����࿪Դ�IJ�������Ŀ, ��Ҫдһ����������Ȼ�Ǽ��dz����ѵ���, �����windows�����п�����Ҫ��ϤDShow, ����Ļ�, ����Ҫѧϰһ�ѿ�Դ��Ŀ(����FFmpeg, MPC, VLC, Mplayer), ������Щ��Դ��Ŀ����һЩϣ������ʵ���Լ�������, ���Եú�����.
һֱ����, �ڶ�ý�岥�������, ��ʹĿǰ�����࿪Դ�IJ�������Ŀ, ��Ҫдһ����������Ȼ�Ǽ��dz����ѵ���, �����windows�����п�����Ҫ��ϤDShow, ����Ļ�, ����Ҫѧϰһ�ѿ�Դ��Ŀ(����FFmpeg, MPC, VLC, Mplayer), ���Ҷ������ǻ���linux, ��windows��ѧϰ�����ܲ�����, Ȼ����Щ��Դ��Ŀ����һЩϣ������ʵ���Լ�������, ���Եú�����.
���, �Ҵ����������Ŀ, ����������򵥵ķ���ʵ���Լ��IJ�����, ���ṩһ�����Ժܷ���ʹ�õĽӿ�.
Ŀǰ, �����������, ��Ҫ���ӵ�FFmpeg�����н���, ����������һ��ͨ�õIJ��������. �����������ܹ����ܸ������ݵĶ���, ���Ժܷ���ķ�װ�Լ������ݶ�ȡģ��, Ҳ���Ժܷ���Ķ����Լ�����Ƶ��Ⱦģ�����Ƶ����ģ��, ��ֻ��Ҫ�ο����е�ʵ�ּ���.
�����ڵ�ǰ��ʵ����, ��Ϊ���˾���ʵ������, ���Դ���������һЩ��Դ��Ŀ�Ĵ���(��Mplayer), ����, ��ϣ���������ܲ��뵽�����Ŀ��һ���о���ѧϰ, ��������Ŀ��.
�����ڵ�ǰ��ʵ����, ��Ϊ���˾���ʵ������, ���Խ����һЩ��Դ��Ŀ�Ĵ���(��Mplayer), ���Ҹô�����Ҫ����windowsƽ̨, ����ֲ��linux������ƽ̨�Ĵ���. ����, ��ϣ���������ܲ��뵽�����Ŀ��һ���о���ѧϰ, ��������Ŀ��.

��: bt_source��һ������libtorrentʵ�ֵ����ݶ���ģ��(source), ���Է���IJ���bt�е���Ƶ, ��Ϊ�漰��һЩ����ԭ��, ��������FreeBSD��ԴЭ��Ļ����ϲ���Դ, �������Ȥ����������dll�滻�������е�source.dll���в���.
avcore��һ����װģ��, ���Ҫ����һ��������, ֻ��Ҫavplayer.h, Ȼ��ʹ�ô���һ��avplayer����, �Ϳ��Դ���һ��������, ������ʹ��avcore�ľ���ϸ�ڿ��Բο�avplayer/main.cpp

��: ��releaseĿ¼���Ѿ������˿��Բ��Ե�ִ���ļ�, ����bt_source.dll��һ������libtorrentʵ�ֵ����ݶ���ģ��(source), ���Է���IJ���bt�е���Ƶ, �������Ȥ���Խ�bt_source.dll����Ϊsource.dll���в���, ������һ�����ſ��ҵ�һ��������Ƶ�ļ�gq.flv.torrent�����ļ����ڲ���.

���, �κη�ʽ(������ҵ�����ҵ)�޸Ļ����ø���Ŀ��ȫ���򲿷�Դ��(��dll), ������������л��Ʒ�ĵ��б�����������������˸���Ŀ, ��ע��url(https://github.com/Jackarain/avplayer), �����͵͵�IJ�������, �����������������͵�����.
��󱾳������߲��е�ʹ�øó������������κ����Ⲣӵ��һ�н���Ȩ.


mail: [email protected]
231 changes: 231 additions & 0 deletions audio/audio.vcproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
<?xml version="1.0" encoding="gb2312"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="audio"
ProjectGUID="{BC5E9C1A-C689-4298-A8EA-2856457DAC28}"
RootNamespace="audio"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;AUDIO_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib dsound.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;AUDIO_EXPORTS"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib dsound.lib"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Ô´Îļþ"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\audio_out.cpp"
>
</File>
<File
RelativePath=".\dsound_render.cpp"
>
</File>
<File
RelativePath=".\wave_render.cpp"
>
</File>
</Filter>
<Filter
Name="Í·Îļþ"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\audio_out.h"
>
</File>
<File
RelativePath=".\audio_render.h"
>
</File>
<File
RelativePath=".\audiocvt.h"
>
</File>
<File
RelativePath=".\dsound_render.h"
>
</File>
<File
RelativePath=".\ins.h"
>
</File>
<File
RelativePath=".\wave_render.h"
>
</File>
</Filter>
<Filter
Name="×ÊÔ´Îļþ"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
75 changes: 75 additions & 0 deletions audio/audio_out.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#include "ins.h"
#include "wave_render.h"
#include "dsound_render.h"
#include "audio_out.h"


#ifdef __cplusplus
extern "C" {
#endif

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

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

EXPORT_API void wave_audio_control(void* ctx, int cmd, void* arg)
{
wave_render* wave = (wave_render*)ctx;
wave->audio_control(cmd, arg);
}

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


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

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

EXPORT_API void dsound_audio_control(void* ctx, int cmd, void* arg)
{
dsound_render* dsound = (dsound_render*)ctx;
dsound->audio_control(cmd, arg);
}

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

#ifdef __cplusplus
}
#endif

39 changes: 39 additions & 0 deletions audio/audio_out.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// audio_out.h
// ~~~~~~~~~~~
//
// Copyright (c) 2011 Jack ([email protected])
//

#ifndef __AUDIO_OUT_H__
#define __AUDIO_OUT_H__

#ifdef AUDIO_EXPORTS
#define EXPORT_API __declspec(dllexport)
#else
#define EXPORT_API __declspec(dllimport)
#endif

#ifdef __cplusplus
extern "C" {
#endif

EXPORT_API int wave_init_audio(void** ctx, uint32_t channels,
uint32_t bits_per_sample, uint32_t sample_rate, int format);
EXPORT_API int wave_play_audio(void* ctx, uint8_t* data, uint32_t size);
EXPORT_API void wave_audio_control(void* ctx, int cmd, void* arg);
EXPORT_API void wave_destory_audio(void* ctx);

EXPORT_API int dsound_init_audio(void** ctx, void* user_data, uint32_t channels,
uint32_t bits_per_sample, uint32_t sample_rate, int format);
EXPORT_API int dsound_play_audio(void* ctx, uint8_t* data, uint32_t size);
EXPORT_API void dsound_audio_control(void* ctx, int cmd, void* arg);
EXPORT_API void dsound_destory_audio(void* ctx);

#ifdef __cplusplus
}
#endif

#endif // __AUDIO_OUT_H__


Loading

0 comments on commit 1a17dc0

Please sign in to comment.