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
NV12ToRgbShader* shader = new NV12ToRgbShader(); | |
if(shader->Init()) | |
{ | |
AVFrame* src = ...; | |
AVFrame* dst = ...; | |
if(shader->Convert(src,dst)) | |
{ | |
} | |
} |
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
//https://github.com/tqk2811/FFmpegArgs | |
FFmpegArg ffmpegArg = new FFmpegArg(); | |
var colorInput = new FilterGraphInput(); | |
colorInput.FilterGraph.ColorFilter().Size(new Size(width,height)).Color(Color.Transparent); | |
var colorVideo = ffmpegArg.AddVideoInput(colorInput,1,0); | |
var colorMap = colorVideo.ImageMaps.First(); | |
List<ImageMap> maps = new List<ImageMap>(); |
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
internal static class Extensions | |
{ | |
static unsafe string av_strerror(int error) | |
{ | |
var bufferSize = 1024; | |
var buffer = stackalloc byte[bufferSize]; | |
ffmpeg.av_strerror(error, buffer, (ulong)bufferSize); | |
var message = Marshal.PtrToStringAnsi((IntPtr)buffer); | |
return message; | |
} |
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
CancellationTokenSource source = null; | |
void Run() | |
{ | |
if(source?.IsCancellationRequested != false)//true hoặc source null | |
{ | |
source?.Dispose(); | |
source = new CancellationTokenSource(); | |
} | |
Task.Run(() => |
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
public static class AdbHelper | |
{ | |
public static string AdbPath = "adb.exe"; | |
public static MemoryStream ExecuteCommandBuffer(string command) | |
{ | |
using(Process process = new Process()) | |
{ | |
process.StartInfo.FileName = AdbPath; | |
process.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory(); |
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
#include "H264_Decoder.h" | |
H264_Decoder::H264_Decoder(h264_decoder_callback frameCallback, void* user) | |
:codec(NULL) | |
,codec_context(NULL) | |
,parser(NULL) | |
,fp(NULL) | |
,frame(0) | |
,cb_frame(frameCallback) | |
,cb_user(user) |
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
using System; | |
using System.Runtime.InteropServices; | |
using FFmpeg.AutoGen; | |
namespace StreamVideo.Ffmpeg | |
{ | |
internal static class Extensions | |
{ | |
static unsafe string av_strerror(int error) | |
{ |
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
// Use OpenGL 3.0+, but don't use GLU | |
#define GLFW_INCLUDE_GL3 | |
#define GLFW_NO_GLU | |
#include <GL/glfw.h> | |
#include <glm/glm.hpp> | |
#include <glm/gtc/matrix_transform.hpp> | |
#include <glm/gtc/type_ptr.hpp> | |
extern "C" { |
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
#include <GUIConstantsEx.au3> | |
#include <Misc.au3> | |
$Form1=GUICreate("" ,150,30,-1,-1,-1 ,-1) | |
$i = GUICtrlCreateInput("4",5,5,20,20) | |
GUISetState(@SW_SHOW,$Form1) | |
Global $dll = DllOpen("user32.dll") | |
AdlibRegister("_HotKeySet",0) | |
While 1 | |
$nMsg=GUIGetMsg () | |
$i_ = GUICtrlRead($i) |
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
var config = { | |
mode: "fixed_servers", | |
rules: { | |
singleProxy: { | |
scheme: "http", | |
host: "{host}", | |
port: "{port}" | |
}, | |
bypassList: ["localhost"] | |
} |