Projects
Staging
vlc-beta
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 203
View file
_service:obs_scm:vlc-beta-20220303.249a76b921.obscpio/doc/libvlc/CMakeLists.txt
Added
@@ -0,0 +1,41 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 3.0) + +# configure with your own path +# -DLIBVLC_SDK_INC:STRING=S:/sources/build/win64/win64/vlc-4.0.0-dev/sdk/include +# -DLIBVLC_SDK_LIB:STRING=S:/sources/build/win64/win64/vlc-4.0.0-dev/sdk/lib +# +# or set them in your VSCode settings +# { +# "cmake.configureSettings": { +# "LIBVLC_SDK_INC": "S:/sources/vlc/include", +# "LIBVLC_SDK_LIB": "S:/sources/build/win64/win64/lib/.libs" +# } +# } + +set("LIBVLC_SDK_INC" "" CACHE PATH "libvlc include folder, containing the vlc/ includes") +set("LIBVLC_SDK_LIB" "" CACHE PATH "libvlc library folder, containing the libvlc libraries") + +project("libvlc samples") + +# define the libvlc external build +add_library(libvlc SHARED IMPORTED GLOBAL) +target_include_directories(libvlc INTERFACE "${LIBVLC_SDK_INC}") +if (MSVC) + set_target_properties(libvlc PROPERTIES IMPORTED_IMPLIB "${LIBVLC_SDK_LIB}/libvlc.lib") +else () + set_target_properties(libvlc PROPERTIES IMPORTED_IMPLIB "${LIBVLC_SDK_LIB}/libvlc.dll.a") +endif () + +if(WIN32) + + add_executable(d3d9_player WIN32 d3d9_player.c) + target_link_libraries(d3d9_player libvlc d3d9) + + add_executable(d3d11_player WIN32 d3d11_player.cpp) + target_compile_definitions(d3d11_player PRIVATE _WIN32_WINNT=0x0601) + target_link_libraries(d3d11_player libvlc d3d11 d3dcompiler uuid) + + add_executable(win_player WIN32 win_player.c) + target_link_libraries(win_player libvlc) + +endif()
View file
_service:obs_scm:vlc-beta-20220303.6eab1792ba.obscpio/doc/libvlc/d3d11_player.cpp -> _service:obs_scm:vlc-beta-20220303.249a76b921.obscpio/doc/libvlc/d3d11_player.cpp
Changed
@@ -1,4 +1,4 @@ -/* compile: g++ d3d11_player.cpp -o d3d11_player.exe -L<path/libvlc> -lvlc -ld3d11 -ld3dcompiler_47 -luuid */ +/* compile: g++ d3d11_player.cpp -o d3d11_player.exe -L<path/libvlc> -lvlc -ld3d11 -ld3dcompiler -luuid */ /* This is the most extreme use case where libvlc is given its own ID3D11DeviceContext and draws in a texture shared with the ID3D11DeviceContext of the app. @@ -153,7 +153,7 @@ NULL, creationFlags, NULL, - NULL, + 0, D3D11_SDK_VERSION, &scd, &ctx->swapchain, @@ -228,9 +228,9 @@ ctx->vertexBufferStride = sizeof(OurVertices[0]); D3D11_MAPPED_SUBRESOURCE ms; - ctx->d3dctx->Map(ctx->pVertexBuffer, NULL, D3D11_MAP_WRITE_DISCARD, NULL, &ms); + ctx->d3dctx->Map(ctx->pVertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &ms); memcpy(ms.pData, OurVertices, sizeof(OurVertices)); - ctx->d3dctx->Unmap(ctx->pVertexBuffer, NULL); + ctx->d3dctx->Unmap(ctx->pVertexBuffer, 0); ctx->quadIndexCount = 6; D3D11_BUFFER_DESC quadDesc = { }; @@ -240,7 +240,7 @@ quadDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; ctx->d3device->CreateBuffer(&quadDesc, NULL, &ctx->pIndexBuffer); - ctx->d3dctx->Map(ctx->pIndexBuffer, NULL, D3D11_MAP_WRITE_DISCARD, NULL, &ms); + ctx->d3dctx->Map(ctx->pIndexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &ms); WORD *triangle_pos = static_cast<WORD*>(ms.pData); triangle_pos[0] = 3; triangle_pos[1] = 1; @@ -249,7 +249,7 @@ triangle_pos[3] = 2; triangle_pos[4] = 1; triangle_pos[5] = 3; - ctx->d3dctx->Unmap(ctx->pIndexBuffer, NULL); + ctx->d3dctx->Unmap(ctx->pIndexBuffer, 0); ctx->d3dctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); @@ -413,10 +413,9 @@ ctx->d3dctx->PSSetShaderResources(0, 1, &ctx->resized.textureShaderInput); - D3D11_RENDER_TARGET_VIEW_DESC renderTargetViewDesc = { - .Format = texDesc.Format, - .ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D, - }; + D3D11_RENDER_TARGET_VIEW_DESC renderTargetViewDesc = { }; + renderTargetViewDesc.Format = texDesc.Format; + renderTargetViewDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D; hr = ctx->d3deviceVLC->CreateRenderTargetView(ctx->resized.textureVLC, &renderTargetViewDesc, &ctx->resized.textureRenderTarget); if (FAILED(hr)) return false; @@ -553,8 +552,8 @@ } ReleaseSRWLockExclusive(&ctx->swapchainLock); - ctx->width = LOWORD(lParam) * (BORDER_RIGHT - BORDER_LEFT) / 2.0f; /* remove the orange part ! */ - ctx->height = HIWORD(lParam) * (BORDER_TOP - BORDER_BOTTOM) / 2.0f; + ctx->width = unsigned(LOWORD(lParam) * (BORDER_RIGHT - BORDER_LEFT) / 2.0f); // remove the orange part ! + ctx->height = unsigned(HIWORD(lParam) * (BORDER_TOP - BORDER_BOTTOM) / 2.0f); // tell libvlc we want a new rendering size // we could also match the source video size and scale in swapchain render @@ -572,7 +571,7 @@ case WM_KEYDOWN: case WM_SYSKEYDOWN: { - int key = tolower( (unsigned char)MapVirtualKey( wParam, 2 ) ); + int key = tolower( MapVirtualKey( (UINT)wParam, 2 ) ); if (key == 'a') { if (AspectRatio == NULL) @@ -622,12 +621,12 @@ /* remove "" around the given path */ if (lpCmdLine[0] == '"') { - file_path = strdup( lpCmdLine+1 ); + file_path = _strdup( lpCmdLine+1 ); if (file_path[strlen(file_path)-1] == '"') file_path[strlen(file_path)-1] = '\0'; } else - file_path = strdup( lpCmdLine ); + file_path = _strdup( lpCmdLine ); p_libvlc = libvlc_new( 0, NULL ); p_media = libvlc_media_new_path( p_libvlc, file_path ); @@ -703,5 +702,5 @@ libvlc_release( p_libvlc ); - return msg.wParam; + return (int)msg.wParam; }
View file
_service:obs_scm:vlc-beta-20220303.6eab1792ba.obscpio/doc/libvlc/d3d9_player.c -> _service:obs_scm:vlc-beta-20220303.249a76b921.obscpio/doc/libvlc/d3d9_player.c
Changed
@@ -315,7 +315,7 @@ case WM_KEYDOWN: case WM_SYSKEYDOWN: { - int key = tolower( (unsigned char)MapVirtualKey( wParam, 2 ) ); + int key = tolower( MapVirtualKey( (UINT)wParam, 2 ) ); if (key == 'a') { if (AspectRatio == NULL) @@ -366,12 +366,12 @@ /* remove "" around the given path */ if (lpCmdLine[0] == '"') { - file_path = strdup( lpCmdLine+1 ); + file_path = _strdup( lpCmdLine+1 ); if (file_path[strlen(file_path)-1] == '"') file_path[strlen(file_path)-1] = '\0'; } else - file_path = strdup( lpCmdLine ); + file_path = _strdup( lpCmdLine ); p_libvlc = libvlc_new( 0, NULL ); p_media = libvlc_media_new_path( p_libvlc, file_path ); @@ -444,5 +444,5 @@ DeleteCriticalSection(&Context.sizeLock); release_direct3d(&Context); - return msg.wParam; + return (int)msg.wParam; }
View file
_service:obs_scm:vlc-beta-20220303.6eab1792ba.obscpio/doc/libvlc/win_player.c -> _service:obs_scm:vlc-beta-20220303.249a76b921.obscpio/doc/libvlc/win_player.c
Changed
@@ -58,7 +58,7 @@ case WM_KEYDOWN: case WM_SYSKEYDOWN: { - int key = tolower( (unsigned char)MapVirtualKey( wParam, 2 ) ); + int key = tolower( MapVirtualKey( (UINT)wParam, 2 ) ); if (key == 'a') { if (AspectRatio == NULL) @@ -108,12 +108,12 @@ /* remove "" around the given path */ if (lpCmdLine[0] == '"') { - file_path = strdup( lpCmdLine+1 ); + file_path = _strdup( lpCmdLine+1 ); if (file_path[strlen(file_path)-1] == '"') file_path[strlen(file_path)-1] = '\0'; } else - file_path = strdup( lpCmdLine ); + file_path = _strdup( lpCmdLine ); Context.p_libvlc = libvlc_new( 0, NULL ); p_media = libvlc_media_new_path( Context.p_libvlc, file_path ); @@ -169,5 +169,5 @@ libvlc_media_player_release( Context.p_mediaplayer ); libvlc_release( Context.p_libvlc ); - return msg.wParam; + return (int)msg.wParam; }
View file
_service:obs_scm:vlc-beta-20220303.6eab1792ba.obscpio/extras/ci/gitlab-ci.yml -> _service:obs_scm:vlc-beta-20220303.249a76b921.obscpio/extras/ci/gitlab-ci.yml
Changed
@@ -140,6 +140,11 @@ else extras/package/win32/build.sh -c -a $HOST_ARCH $NIGHTLY_EXTRA_BUILD_FLAGS $LIBVLC_EXTRA_BUILD_FLAGS $UWP_EXTRA_BUILD_FLAGS fi + if [ "${CI_JOB_NAME}" = "win64" ]; then + cmake -DLIBVLC_SDK_INC:STRING=${CI_PROJECT_DIR}/include -DLIBVLC_SDK_LIB:STRING=${CI_PROJECT_DIR}/${SHORTARCH}/lib/.libs -H${CI_PROJECT_DIR}/doc/libvlc -B${CI_PROJECT_DIR}/doc/libvlc/build \ + -G Ninja -DCMAKE_C_COMPILER=${TRIPLET}-gcc -DCMAKE_CXX_COMPILER=${TRIPLET}-g++ -DCMAKE_SYSTEM_NAME=Windows + cmake --build ${CI_PROJECT_DIR}/doc/libvlc/build + fi win32: extends: .win-common
View file
_service:obs_scm:vlc-beta-20220303.6eab1792ba.obscpio/modules/access/nfs.c -> _service:obs_scm:vlc-beta-20220303.249a76b921.obscpio/modules/access/nfs.c
Changed
@@ -213,11 +213,11 @@ p_access) < 0) { msg_Err(p_access, "nfs_read_async failed"); - return -1; + return 0; } if (vlc_nfs_mainloop(p_access, nfs_read_finished_cb) < 0) - return -1; + return 0; return p_sys->res.read.i_len; }
View file
_service:obs_scm:vlc-beta-20220303.6eab1792ba.obscpio/modules/access/smb2.c -> _service:obs_scm:vlc-beta-20220303.249a76b921.obscpio/modules/access/smb2.c
Changed
@@ -278,10 +278,7 @@ { struct access_sys *sys = access->p_sys; - if (sys->error_status != 0) - return -1; - - if (sys->eof) + if (sys->eof || sys->error_status != 0) return 0; /* Limit the read size since smb2_read_async() will complete only after @@ -297,13 +294,13 @@ smb2_read_cb, &op) < 0) { VLC_SMB2_SET_ERROR(&op, "smb2_read_async", 1); - return -1; + return 0; } if (vlc_smb2_mainloop(&op, false) < 0) { sys->error_status = op.error_status; - return -1; + return 0; } if (op.res.read.len == 0)
View file
_service:obs_scm:vlc-beta.obsinfo
Changed
@@ -1,5 +1,5 @@ name: vlc-beta -version: 20220303.6eab1792ba -mtime: 1646331425 -commit: 6eab1792ba5e484d27f157b922b1749c4a6d20b6 +version: 20220303.249a76b921 +mtime: 1646345414 +commit: 249a76b921b1a742ae9d4fa459ea7107bca08482
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.