mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-08 17:06:26 +00:00
Merge branch 'master' into pc
This commit is contained in:
@@ -25,12 +25,10 @@ static FILE* fd;
|
||||
static const char* fileName = "fake.h264";
|
||||
|
||||
void decoder_renderer_setup(int width, int height, int redrawRate, void* context, int drFlags) {
|
||||
printf("decoder_renderer_setup %dx%d %dfps\n", width, height, redrawRate);
|
||||
fd = fopen(fileName, "w");
|
||||
}
|
||||
|
||||
void decoder_renderer_release() {
|
||||
printf("decoder_renderer_release\n");
|
||||
void decoder_renderer_cleanup() {
|
||||
fclose(fd);
|
||||
}
|
||||
|
||||
@@ -45,8 +43,6 @@ int decoder_renderer_submit_decode_unit(PDECODE_UNIT decodeUnit) {
|
||||
|
||||
DECODER_RENDERER_CALLBACKS decoder_callbacks_fake = {
|
||||
.setup = decoder_renderer_setup,
|
||||
.start = NULL,
|
||||
.stop = NULL,
|
||||
.release = decoder_renderer_release,
|
||||
.cleanup = decoder_renderer_cleanup,
|
||||
.submitDecodeUnit = decoder_renderer_submit_decode_unit,
|
||||
};
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
|
||||
#include "../video.h"
|
||||
|
||||
#include "vpu_io.h"
|
||||
#include "vpu_lib.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
@@ -43,6 +40,9 @@
|
||||
#include <linux/v4l2-controls.h>
|
||||
#include <linux/videodev2.h>
|
||||
|
||||
#include <vpu_io.h>
|
||||
#include <vpu_lib.h>
|
||||
|
||||
#define STREAM_BUF_SIZE 0x200000
|
||||
#define PS_SAVE_SIZE 0x080000
|
||||
|
||||
@@ -72,6 +72,10 @@ static int disp_clr_index = 0;
|
||||
static FrameBuffer *fb;
|
||||
static struct v4l2_buffer dbuf;
|
||||
|
||||
bool video_imx_init() {
|
||||
return vpu_Init(NULL) == RETCODE_SUCCESS;
|
||||
}
|
||||
|
||||
static void decoder_renderer_setup(int width, int height, int redrawRate, void* context, int drFlags) {
|
||||
struct mxcfb_gbl_alpha alpha;
|
||||
|
||||
@@ -94,11 +98,6 @@ static void decoder_renderer_setup(int width, int height, int redrawRate, void*
|
||||
|
||||
close(fd_fb);
|
||||
|
||||
if (vpu_Init(NULL) != RETCODE_SUCCESS){
|
||||
fprintf(stderr, "Can't intialize VPU\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
mem_desc.size = STREAM_BUF_SIZE;
|
||||
if (IOGetPhyMem(&mem_desc)){
|
||||
fprintf(stderr, "Can't get physical memory address\n");
|
||||
@@ -413,7 +412,7 @@ static int decoder_renderer_submit_decode_unit(PDECODE_UNIT decodeUnit) {
|
||||
return DR_OK;
|
||||
}
|
||||
|
||||
static void decoder_renderer_release() {
|
||||
static void decoder_renderer_cleanup() {
|
||||
IOFreePhyMem(&ps_mem_desc);
|
||||
IOFreePhyMem(&slice_mem_desc);
|
||||
|
||||
@@ -424,8 +423,6 @@ static void decoder_renderer_release() {
|
||||
|
||||
DECODER_RENDERER_CALLBACKS decoder_callbacks_imx = {
|
||||
.setup = decoder_renderer_setup,
|
||||
.start = NULL,
|
||||
.stop = NULL,
|
||||
.release = decoder_renderer_release,
|
||||
.cleanup = decoder_renderer_cleanup,
|
||||
.submitDecodeUnit = decoder_renderer_submit_decode_unit,
|
||||
};
|
||||
|
||||
@@ -30,14 +30,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "../video.h"
|
||||
|
||||
#include "bcm_host.h"
|
||||
#include "ilclient.h"
|
||||
#include "h264_stream.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <ilclient.h>
|
||||
#include <bcm_host.h>
|
||||
|
||||
static TUNNEL_T tunnel[2];
|
||||
static COMPONENT_T *list[3];
|
||||
static ILCLIENT_T *client;
|
||||
@@ -129,7 +130,7 @@ static void decoder_renderer_setup(int width, int height, int redrawRate, void*
|
||||
}
|
||||
}
|
||||
|
||||
static void decoder_renderer_stop() {
|
||||
static void decoder_renderer_cleanup() {
|
||||
int status = 0;
|
||||
|
||||
buf->nFilledLen = 0;
|
||||
@@ -144,9 +145,7 @@ static void decoder_renderer_stop() {
|
||||
ilclient_flush_tunnels(tunnel, 0);
|
||||
|
||||
ilclient_disable_port_buffers(list[0], 130, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static void decoder_renderer_release() {
|
||||
ilclient_disable_tunnel(tunnel);
|
||||
ilclient_teardown_tunnels(tunnel);
|
||||
|
||||
@@ -227,8 +226,6 @@ static int decoder_renderer_submit_decode_unit(PDECODE_UNIT decodeUnit) {
|
||||
|
||||
DECODER_RENDERER_CALLBACKS decoder_callbacks_omx = {
|
||||
.setup = decoder_renderer_setup,
|
||||
.start = NULL,
|
||||
.stop = decoder_renderer_stop,
|
||||
.release = decoder_renderer_release,
|
||||
.cleanup = decoder_renderer_cleanup,
|
||||
.submitDecodeUnit = decoder_renderer_submit_decode_unit,
|
||||
};
|
||||
|
||||
@@ -61,7 +61,7 @@ static void sdl_setup(int width, int height, int redrawRate, void* context, int
|
||||
screen_height = height;
|
||||
}
|
||||
|
||||
static void sdl_release() {
|
||||
static void sdl_cleanup() {
|
||||
ffmpeg_destroy();
|
||||
}
|
||||
|
||||
@@ -109,8 +109,6 @@ static int sdl_submit_decode_unit(PDECODE_UNIT decodeUnit) {
|
||||
|
||||
DECODER_RENDERER_CALLBACKS decoder_callbacks_sdl = {
|
||||
.setup = sdl_setup,
|
||||
.start = NULL,
|
||||
.stop = NULL,
|
||||
.release = sdl_release,
|
||||
.cleanup = sdl_cleanup,
|
||||
.submitDecodeUnit = sdl_submit_decode_unit,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user