Open xs23933 opened 2 years ago
I doubt we support VIDEO_BIND_RQ
in Go.
Here's an example in C++: https://github.com/c-smile/sciter-sdk/blob/master/include/behaviors/behavior_video_generator.cpp#L40-L60
thanks I will study again
sciter-x-video-api.h is c++ syntax so it is difficult
I modified the file name sciter-x-video-api.hpp and include it But the compiler still prompts error: unknown type name 'namespace'
add scider-x-video.h use c style but how to call library member method , i can't
#ifndef __SCITER_X_VIDEO__
#define __SCITER_X_VIDEO__
#include <sciter-x.h>
typedef struct video_source {
SBOOL SCFN( play )();
SBOOL SCFN( pause )();
SBOOL SCFN( stop )();
SBOOL SCFN( get_is_ended )(SBOOL *eos);
SBOOL SCFN( get_position )(double *seconds);
SBOOL SCFN( set_position )(double seconds);
SBOOL SCFN( get_duration )(double *seconds);
// audio
SBOOL SCFN( get_volume )(double* vol);
SBOOL SCFN( set_volume )(double vol);
SBOOL SCFN( get_balance )(double* vol);
SBOOL SCFN( set_balance )(double vol);
} video_source_t;
typedef struct video_destination{
SBOOL SCFN( is_alive )();
SBOOL SCFN( start_streaming )(
INT frame_width,
INT frame_height,
INT color_space,
video_source_t* src
);
SBOOL SCFN( stop_streaming )();
SBOOL SCFN( render_frame )(const BYTE* frame_data, UINT frame_data_size);
} video_destination_t;
video_destination_t* SVAPI() {
return _SVAPI(NULL);
};
#endif
video.go
package sciter
// #include "sciter-x.h"
import "C"
import "unsafe"
type VideoSource C.video_source_t
type VideoDestination C.video_destination_t
func NewVideoDestination(ptr C.UINT_PTR) *VideoDestination {
vd := &VideoDestination{}
vd = (*VideoDestination)(unsafe.Pointer(uintptr(ptr)))
return vd
}
I need to do video rendering about video frame
Render the h264 frame decoded by libavcodec to the display
Only see sciter VIDEO_BIND_RQ but no use case
或者任何 in-memory:cursor demo