This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Napi::Value FGM::test(const Napi::CallbackInfo &info) { | |
Napi::Env env = info.Env(); | |
auto cb = info[0].As<Napi::Function>(); | |
threadSafeCallback = ThreadSafeFunction::Create(cb); | |
std::thread t([threadSafeCallback]() => { | |
// do something | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
libvlc_media_add_option(m, ":avcodec-hw=dxva2"); | |
// Below is the information about option list. | |
/* Input */ | |
var_Create (mp, "rate", VLC_VAR_FLOAT|VLC_VAR_DOINHERIT); | |
var_Create (mp, "sout", VLC_VAR_STRING); | |
var_Create (mp, "demux-filter", VLC_VAR_STRING); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----------------------------------------------------------- | |
// YUV TO RGB BT.601 For SD TV | |
//----------------------------------------------------------- | |
cbuffer PS_CONSTANT_BUFFER : register(b0) | |
{ | |
float Opacity; | |
float ignoreA; | |
float ignoreB; | |
float ignoreC; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------ | |
// Creating texture for rendering video | |
//------------------------------------------------ | |
// ID3D11Device* Device | |
ID3D11Texture2D* texture = nullptr; | |
D3D11_TEXTURE2D_DESC td; | |
RtlZeroMemory(&td, sizeof(D3D11_TEXTURE2D_DESC)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VLC prepares to render a video frame. | |
static void* lock(void* data, void** p_pixels) { | |
return NULL; // Picture identifier, not needed here. | |
} | |
// VLC just rendered a video frame. | |
static void unlock(void* data, void* id, void* const* p_pixels) { | |
} | |
// VLC wants to display a video frame. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void picture_CopyPixels( picture_t *p_dst, const picture_t *p_src ) | |
{ | |
for( int i = 0; i < p_src->i_planes ; i++ ) | |
plane_CopyPixels( p_dst->p+i, p_src->p+i ); | |
assert( p_dst->context == NULL ); | |
if( p_src->context != NULL ) | |
p_dst->context = p_src->context->copy( p_src->context ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
libvlc_media_track_t** pp_tracks; | |
unsigned i_count = libvlc_media_tracks_get(m, &pp_tracks); | |
if (i_count > 0) { | |
for (unsigned i = 0; i < i_count; ++i) | |
{ | |
libvlc_media_track_t* p_track = pp_tracks[i]; | |
switch (p_track->i_type) | |
{ | |
case libvlc_track_audio: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** A fragment shader to convert NV12 to RGB. | |
* Input textures Y - is a block of size w*h. | |
* texture UV is of size w*h/2. | |
* Remember, both U and V are individually of size w/2*h/2, but they are interleaved. | |
* The layout looks like this : | |
* ---------- | |
* | | | |
* | Y | size = w*h | |
* | | | |
* |________| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void copy_texture(GLuint srcTex, GLuint destTex, int width, int height) { | |
GLuint fboIds[2]; | |
glGenFramebuffers(2, fboIds); | |
glBindFramebuffer(GL_READ_FRAMEBUFFER, fboIds[0]); | |
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, srcTex, 0); | |
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fboIds[1]); | |
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, destTex, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Note: this Google copyright notice only applies to the original file, which has large sections copy-pasted here. my changes are under CC0 (public domain). | |
* Copyright 2015 Google Inc. | |
* | |
* Use of this source code is governed by a BSD-style license that can be | |
* found in the LICENSE file. | |
*/ | |
/* | |
The official instructions don't work well. These alternative instructions are intended to be the shortest path to get a minimal setup running. |
OlderNewer