Changes of Revision 203
_service:obs_scm:vlc-beta-20220303.249a76b921.obscpio/doc/libvlc/CMakeLists.txt
Added
x
1
2
+CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
3
+
4
+# configure with your own path
5
+# -DLIBVLC_SDK_INC:STRING=S:/sources/build/win64/win64/vlc-4.0.0-dev/sdk/include
6
+# -DLIBVLC_SDK_LIB:STRING=S:/sources/build/win64/win64/vlc-4.0.0-dev/sdk/lib
7
+#
8
+# or set them in your VSCode settings
9
+# {
10
+# "cmake.configureSettings": {
11
+# "LIBVLC_SDK_INC": "S:/sources/vlc/include",
12
+# "LIBVLC_SDK_LIB": "S:/sources/build/win64/win64/lib/.libs"
13
+# }
14
+# }
15
+
16
+set("LIBVLC_SDK_INC" "" CACHE PATH "libvlc include folder, containing the vlc/ includes")
17
+set("LIBVLC_SDK_LIB" "" CACHE PATH "libvlc library folder, containing the libvlc libraries")
18
+
19
+project("libvlc samples")
20
+
21
+# define the libvlc external build
22
+add_library(libvlc SHARED IMPORTED GLOBAL)
23
+target_include_directories(libvlc INTERFACE "${LIBVLC_SDK_INC}")
24
+if (MSVC)
25
+ set_target_properties(libvlc PROPERTIES IMPORTED_IMPLIB "${LIBVLC_SDK_LIB}/libvlc.lib")
26
+else ()
27
+ set_target_properties(libvlc PROPERTIES IMPORTED_IMPLIB "${LIBVLC_SDK_LIB}/libvlc.dll.a")
28
+endif ()
29
+
30
+if(WIN32)
31
+
32
+ add_executable(d3d9_player WIN32 d3d9_player.c)
33
+ target_link_libraries(d3d9_player libvlc d3d9)
34
+
35
+ add_executable(d3d11_player WIN32 d3d11_player.cpp)
36
+ target_compile_definitions(d3d11_player PRIVATE _WIN32_WINNT=0x0601)
37
+ target_link_libraries(d3d11_player libvlc d3d11 d3dcompiler uuid)
38
+
39
+ add_executable(win_player WIN32 win_player.c)
40
+ target_link_libraries(win_player libvlc)
41
+
42
+endif()
43
_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
102
1
2
-/* compile: g++ d3d11_player.cpp -o d3d11_player.exe -L<path/libvlc> -lvlc -ld3d11 -ld3dcompiler_47 -luuid */
3
+/* compile: g++ d3d11_player.cpp -o d3d11_player.exe -L<path/libvlc> -lvlc -ld3d11 -ld3dcompiler -luuid */
4
5
/* This is the most extreme use case where libvlc is given its own ID3D11DeviceContext
6
and draws in a texture shared with the ID3D11DeviceContext of the app.
7
8
NULL,
9
creationFlags,
10
NULL,
11
- NULL,
12
+ 0,
13
D3D11_SDK_VERSION,
14
&scd,
15
&ctx->swapchain,
16
17
ctx->vertexBufferStride = sizeof(OurVertices[0]);
18
19
D3D11_MAPPED_SUBRESOURCE ms;
20
- ctx->d3dctx->Map(ctx->pVertexBuffer, NULL, D3D11_MAP_WRITE_DISCARD, NULL, &ms);
21
+ ctx->d3dctx->Map(ctx->pVertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &ms);
22
memcpy(ms.pData, OurVertices, sizeof(OurVertices));
23
- ctx->d3dctx->Unmap(ctx->pVertexBuffer, NULL);
24
+ ctx->d3dctx->Unmap(ctx->pVertexBuffer, 0);
25
26
ctx->quadIndexCount = 6;
27
D3D11_BUFFER_DESC quadDesc = { };
28
29
quadDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
30
ctx->d3device->CreateBuffer(&quadDesc, NULL, &ctx->pIndexBuffer);
31
32
- ctx->d3dctx->Map(ctx->pIndexBuffer, NULL, D3D11_MAP_WRITE_DISCARD, NULL, &ms);
33
+ ctx->d3dctx->Map(ctx->pIndexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &ms);
34
WORD *triangle_pos = static_cast<WORD*>(ms.pData);
35
triangle_pos[0] = 3;
36
triangle_pos[1] = 1;
37
38
triangle_pos[3] = 2;
39
triangle_pos[4] = 1;
40
triangle_pos[5] = 3;
41
- ctx->d3dctx->Unmap(ctx->pIndexBuffer, NULL);
42
+ ctx->d3dctx->Unmap(ctx->pIndexBuffer, 0);
43
44
ctx->d3dctx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
45
46
47
48
ctx->d3dctx->PSSetShaderResources(0, 1, &ctx->resized.textureShaderInput);
49
50
- D3D11_RENDER_TARGET_VIEW_DESC renderTargetViewDesc = {
51
- .Format = texDesc.Format,
52
- .ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D,
53
- };
54
+ D3D11_RENDER_TARGET_VIEW_DESC renderTargetViewDesc = { };
55
+ renderTargetViewDesc.Format = texDesc.Format;
56
+ renderTargetViewDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
57
hr = ctx->d3deviceVLC->CreateRenderTargetView(ctx->resized.textureVLC, &renderTargetViewDesc, &ctx->resized.textureRenderTarget);
58
if (FAILED(hr)) return false;
59
60
61
}
62
ReleaseSRWLockExclusive(&ctx->swapchainLock);
63
64
- ctx->width = LOWORD(lParam) * (BORDER_RIGHT - BORDER_LEFT) / 2.0f; /* remove the orange part ! */
65
- ctx->height = HIWORD(lParam) * (BORDER_TOP - BORDER_BOTTOM) / 2.0f;
66
+ ctx->width = unsigned(LOWORD(lParam) * (BORDER_RIGHT - BORDER_LEFT) / 2.0f); // remove the orange part !
67
+ ctx->height = unsigned(HIWORD(lParam) * (BORDER_TOP - BORDER_BOTTOM) / 2.0f);
68
69
// tell libvlc we want a new rendering size
70
// we could also match the source video size and scale in swapchain render
71
72
case WM_KEYDOWN:
73
case WM_SYSKEYDOWN:
74
{
75
- int key = tolower( (unsigned char)MapVirtualKey( wParam, 2 ) );
76
+ int key = tolower( MapVirtualKey( (UINT)wParam, 2 ) );
77
if (key == 'a')
78
{
79
if (AspectRatio == NULL)
80
81
/* remove "" around the given path */
82
if (lpCmdLine[0] == '"')
83
{
84
- file_path = strdup( lpCmdLine+1 );
85
+ file_path = _strdup( lpCmdLine+1 );
86
if (file_path[strlen(file_path)-1] == '"')
87
file_path[strlen(file_path)-1] = '\0';
88
}
89
else
90
- file_path = strdup( lpCmdLine );
91
+ file_path = _strdup( lpCmdLine );
92
93
p_libvlc = libvlc_new( 0, NULL );
94
p_media = libvlc_media_new_path( p_libvlc, file_path );
95
96
97
libvlc_release( p_libvlc );
98
99
- return msg.wParam;
100
+ return (int)msg.wParam;
101
}
102
_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
32
1
2
case WM_KEYDOWN:
3
case WM_SYSKEYDOWN:
4
{
5
- int key = tolower( (unsigned char)MapVirtualKey( wParam, 2 ) );
6
+ int key = tolower( MapVirtualKey( (UINT)wParam, 2 ) );
7
if (key == 'a')
8
{
9
if (AspectRatio == NULL)
10
11
/* remove "" around the given path */
12
if (lpCmdLine[0] == '"')
13
{
14
- file_path = strdup( lpCmdLine+1 );
15
+ file_path = _strdup( lpCmdLine+1 );
16
if (file_path[strlen(file_path)-1] == '"')
17
file_path[strlen(file_path)-1] = '\0';
18
}
19
else
20
- file_path = strdup( lpCmdLine );
21
+ file_path = _strdup( lpCmdLine );
22
23
p_libvlc = libvlc_new( 0, NULL );
24
p_media = libvlc_media_new_path( p_libvlc, file_path );
25
26
DeleteCriticalSection(&Context.sizeLock);
27
release_direct3d(&Context);
28
29
- return msg.wParam;
30
+ return (int)msg.wParam;
31
}
32
_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
32
1
2
case WM_KEYDOWN:
3
case WM_SYSKEYDOWN:
4
{
5
- int key = tolower( (unsigned char)MapVirtualKey( wParam, 2 ) );
6
+ int key = tolower( MapVirtualKey( (UINT)wParam, 2 ) );
7
if (key == 'a')
8
{
9
if (AspectRatio == NULL)
10
11
/* remove "" around the given path */
12
if (lpCmdLine[0] == '"')
13
{
14
- file_path = strdup( lpCmdLine+1 );
15
+ file_path = _strdup( lpCmdLine+1 );
16
if (file_path[strlen(file_path)-1] == '"')
17
file_path[strlen(file_path)-1] = '\0';
18
}
19
else
20
- file_path = strdup( lpCmdLine );
21
+ file_path = _strdup( lpCmdLine );
22
23
Context.p_libvlc = libvlc_new( 0, NULL );
24
p_media = libvlc_media_new_path( Context.p_libvlc, file_path );
25
26
libvlc_media_player_release( Context.p_mediaplayer );
27
libvlc_release( Context.p_libvlc );
28
29
- return msg.wParam;
30
+ return (int)msg.wParam;
31
}
32
_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
13
1
2
else
3
extras/package/win32/build.sh -c -a $HOST_ARCH $NIGHTLY_EXTRA_BUILD_FLAGS $LIBVLC_EXTRA_BUILD_FLAGS $UWP_EXTRA_BUILD_FLAGS
4
fi
5
+ if [ "${CI_JOB_NAME}" = "win64" ]; then
6
+ 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 \
7
+ -G Ninja -DCMAKE_C_COMPILER=${TRIPLET}-gcc -DCMAKE_CXX_COMPILER=${TRIPLET}-g++ -DCMAKE_SYSTEM_NAME=Windows
8
+ cmake --build ${CI_PROJECT_DIR}/doc/libvlc/build
9
+ fi
10
11
win32:
12
extends: .win-common
13
_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
15
1
2
p_access) < 0)
3
{
4
msg_Err(p_access, "nfs_read_async failed");
5
- return -1;
6
+ return 0;
7
}
8
9
if (vlc_nfs_mainloop(p_access, nfs_read_finished_cb) < 0)
10
- return -1;
11
+ return 0;
12
13
return p_sys->res.read.i_len;
14
}
15
_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
29
1
2
{
3
struct access_sys *sys = access->p_sys;
4
5
- if (sys->error_status != 0)
6
- return -1;
7
-
8
- if (sys->eof)
9
+ if (sys->eof || sys->error_status != 0)
10
return 0;
11
12
/* Limit the read size since smb2_read_async() will complete only after
13
14
smb2_read_cb, &op) < 0)
15
{
16
VLC_SMB2_SET_ERROR(&op, "smb2_read_async", 1);
17
- return -1;
18
+ return 0;
19
}
20
21
if (vlc_smb2_mainloop(&op, false) < 0)
22
{
23
sys->error_status = op.error_status;
24
- return -1;
25
+ return 0;
26
}
27
28
if (op.res.read.len == 0)
29
_service:obs_scm:vlc-beta.obsinfo
Changed
10
1
2
name: vlc-beta
3
-version: 20220303.6eab1792ba
4
-mtime: 1646331425
5
-commit: 6eab1792ba5e484d27f157b922b1749c4a6d20b6
6
+version: 20220303.249a76b921
7
+mtime: 1646345414
8
+commit: 249a76b921b1a742ae9d4fa459ea7107bca08482
9
10