Add video stream support
parent
90552382db
commit
d4123f440e
@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include "message.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t STREAM_HOST = 1;
|
||||
static const uint8_t STREAM_INDEX = 0;
|
||||
|
||||
#define STREAM_CTRL_CMD 0xD23F
|
||||
|
||||
#define VIDEO_STREAM_PORT 40921
|
||||
|
||||
enum STREAMSTATE {
|
||||
STREAMSTATE_OFF = 0,
|
||||
STREAMSTATE_ON = 1
|
||||
};
|
||||
|
||||
enum STREAMRESOLUTION {
|
||||
RES_720P = 0,
|
||||
RES_360P = 1,
|
||||
RES_540P = 2
|
||||
};
|
||||
|
||||
enum STREAMCTRL {
|
||||
STREAMCTRL_SDK = 1,
|
||||
STREAMCTRL_VIDEO = 2,
|
||||
STREAMCTRL_AUDIO = 3
|
||||
};
|
||||
|
||||
void
|
||||
stream_ctrl (
|
||||
union Request* req,
|
||||
uint16_t seq,
|
||||
bool ack,
|
||||
enum STREAMSTATE state,
|
||||
enum STREAMRESOLUTION res,
|
||||
enum STREAMCTRL ctrl );
|
||||
|
@ -0,0 +1,20 @@
|
||||
#include "message.h"
|
||||
#include "connection.h"
|
||||
#include "robomaster.h"
|
||||
|
||||
void
|
||||
stream_ctrl (
|
||||
union Request* req,
|
||||
uint16_t seq,
|
||||
bool ack,
|
||||
enum STREAMSTATE state,
|
||||
enum STREAMRESOLUTION res,
|
||||
enum STREAMCTRL ctrl ) {
|
||||
req->stream.state = state;
|
||||
req->stream.resolution = res;
|
||||
req->stream.ctrl = ctrl;
|
||||
req->stream.conn_type = 0; // Hardcode to WiFi
|
||||
req_finalize(seq, STREAM_CTRL_CMD, ack, req);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue