Skip to content

Commit

Permalink
modified: src/decoder/h264/H264Decoder.cpp
Browse files Browse the repository at this point in the history
	modified:   src/decoder/h264/H264Decoder.h
	modified:   src/demo/StreamPlayer.h
	modified:   src/player/misc/x_pl_socket.cpp
	modified:   src/render/jo_render/JoRender.h
	modified:   src/utils/utils.def
	modified:   vs2008/joisc/H264Decoder.vcproj
	modified:   vs2008/joisc/JoRender.vcproj
	modified:   vs2008/joisc/PlayerDemo.vcproj
  • Loading branch information
joorhy committed Nov 5, 2013
1 parent 3586c76 commit d004ea8
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 6 deletions.
11 changes: 10 additions & 1 deletion src/decoder/h264/H264Decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,32 @@ j_result_t CH264Decoder::InidDecoder()
{
J_OS::LOGINFO("CH264Decoder::InidDecoder");
#if LIBAVCODEC_VERSION_MAJOR < 54
//avcodec_init();
avcodec_init();
#endif
avcodec_register_all();
#ifdef _DEBUG
av_log_set_callback(LogCallBack);
#endif
av_lockmgr_register(lockmgr);
av_init_packet(&m_Packet);
#ifdef WIN32
m_pCodec = avcodec_find_decoder(CODEC_ID_H264);
m_pContext = avcodec_alloc_context();
#else
m_pCodec = avcodec_find_decoder(AV_CODEC_ID_H264);
m_pContext = avcodec_alloc_context3(m_pCodec);
#endif
if(!m_pCodec || !m_pContext)
return J_DECODER_INIT_ERROR;

if(m_pCodec->capabilities & CODEC_CAP_TRUNCATED)
m_pContext->flags|= CODEC_FLAG_TRUNCATED; /*we do not send complete frames */

#ifdef WIN32
if(avcodec_open(m_pContext,m_pCodec) < 0)
#else
if(avcodec_open2(m_pContext,m_pCodec, NULL) < 0)
#endif
return J_DECODER_INIT_ERROR;

m_pPicture = avcodec_alloc_frame();
Expand Down
2 changes: 2 additions & 0 deletions src/decoder/h264/H264Decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ extern "C"{
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libswscale/swscale.h"
#ifndef WIN32
#include "libavutil/imgutils.h"
#endif
}

class CH264Decoder : public J_Decoder
Expand Down
1 change: 1 addition & 0 deletions src/demo/StreamPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class CStreamPlayer : public wxDialog
wxWindow m_displayWindow2;
wxWindow m_displayWindow3;
wxWindow m_displayWindow4;

wxPanel *m_display1;
wxPanel *m_display2;
wxPanel *m_display3;
Expand Down
2 changes: 1 addition & 1 deletion src/player/misc/x_pl_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ J_PL_RESULT J_PlSocket::NonblockConnect(const char *pAddr, int nPort,unsigned in
FD_SET(m_hSocket,&rset);
wset = rset;
//timeout.tv_sec = unTimeout;
timeout.tv_usec = 10 * 1000;
timeout.tv_usec = 100 * 1000;
if((nRet = select(1,0,&rset,0,&timeout)) == 0)
{
closesocket(m_hSocket);
Expand Down
9 changes: 9 additions & 0 deletions src/render/jo_render/JoRender.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ class CJoRender : public J_Render
virtual j_result_t DisplayFrame(j_char_t *pData, j_int32_t nLen);
virtual j_result_t DeinitRender();
virtual j_result_t SetDisplayParam(const J_VideoDisplayParam &displayParam);
virtual j_result_t AspectRatio(j_int32_t nWidth, j_int32_t nHeight)
{
m_width = nWidth;
m_height = nHeight;
return J_OK;
}

private:
j_result_t OpenDDraw();
Expand All @@ -51,6 +57,9 @@ class CJoRender : public J_Render
LPDIRECTDRAWSURFACE7 m_pDDSPrimary; //DirectDrawÏÔʾ»º³å¿é Primary surface
LPDIRECTDRAWSURFACE7 m_pSurface;
WNDPROC m_oldProc;

j_int32_t m_width;
j_int32_t m_height;
};

#endif //~__JORENDER_H_
12 changes: 11 additions & 1 deletion src/utils/utils.def
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,14 @@ sqlite3_value_text16
sqlite3_value_text16be
sqlite3_value_text16le
sqlite3_value_type
sqlite3_vmprintf
sqlite3_vmprintf
faacEncGetVersion
faacEncGetCurrentConfiguration
faacEncSetConfiguration
faacEncOpen
faacEncGetDecoderSpecificInfo
faacEncEncode
faacEncClose
mlt_based_coder_init
G722_1_1C_Float_encoder
G722_1_1C_Float_decoder
2 changes: 1 addition & 1 deletion vs2008/joisc/H264Decoder.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../src/core;../../include/ffmpeg;../../src/misc"
AdditionalIncludeDirectories="../../src/core;../../include/windows/ffmpeg;../../src/misc"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;H264DECODER_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="0"
Expand Down
2 changes: 1 addition & 1 deletion vs2008/joisc/JoRender.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../src/core;../../include/ffmpeg;../../src/utils;../../src/misc"
AdditionalIncludeDirectories="../../src/core;../../include/windows/ffmpeg;../../src/utils;../../src/misc"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;JORENDER_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="0"
Expand Down
6 changes: 5 additions & 1 deletion vs2008/joisc/PlayerDemo.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,18 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\src\demo\StreamPlayer.h"
>
</File>
</Filter>
<Filter
Name="src"
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}"
>
<File
RelativePath="..\..\src\demo\StreamPlayer.cpp"
RelativePath="..\..\src\demo\StreamPlayerWin.cpp"
>
</File>
</Filter>
Expand Down

0 comments on commit d004ea8

Please sign in to comment.