mirror of
https://github.com/openmv/openmv.git
synced 2025-09-26 23:09:13 +08:00
modules/py_omv: Remove disable fb from omv module.
This commit is contained in:
parent
a45e458935
commit
84c3db58a4
@ -61,7 +61,6 @@ void framebuffer_init_fb(framebuffer_t *fb, size_t size, bool dynamic) {
|
||||
memset(fb, 0, sizeof(*fb));
|
||||
|
||||
fb->raw_size = size;
|
||||
fb->streaming_enabled = true;
|
||||
fb->dynamic = dynamic;
|
||||
framebuffer_set_buffers(fb, 1);
|
||||
}
|
||||
@ -102,8 +101,7 @@ void framebuffer_update_jpeg_buffer(framebuffer_t *fb) {
|
||||
framebuffer_init_image(fb, &main_fb_src);
|
||||
image_t *src = &main_fb_src;
|
||||
|
||||
if (src->pixfmt != PIXFORMAT_INVALID &&
|
||||
fb->streaming_enabled && jpegbuffer->enabled) {
|
||||
if (src->pixfmt != PIXFORMAT_INVALID && jpegbuffer->enabled) {
|
||||
if (src->is_compressed) {
|
||||
bool does_not_fit = false;
|
||||
|
||||
@ -236,14 +234,6 @@ int32_t framebuffer_get_depth(framebuffer_t *fb) {
|
||||
return fb->bpp;
|
||||
}
|
||||
|
||||
void framebuffer_set_streaming(framebuffer_t *fb, bool enable) {
|
||||
fb->streaming_enabled = enable;
|
||||
}
|
||||
|
||||
bool framebuffer_get_streaming(framebuffer_t *fb) {
|
||||
return fb->streaming_enabled;
|
||||
}
|
||||
|
||||
void framebuffer_encode(framebuffer_t *fb, uint8_t *ptr, image_t *img) {
|
||||
*ptr++ = 0xFE;
|
||||
|
||||
|
@ -42,7 +42,6 @@ typedef struct framebuffer {
|
||||
int32_t w, h;
|
||||
int32_t u, v;
|
||||
PIXFORMAT_STRUCT;
|
||||
int32_t streaming_enabled;
|
||||
uint32_t raw_size;
|
||||
uint32_t buff_size;
|
||||
uint32_t n_buffers;
|
||||
@ -96,10 +95,6 @@ int32_t framebuffer_get_width(framebuffer_t *fb);
|
||||
int32_t framebuffer_get_height(framebuffer_t *fb);
|
||||
int32_t framebuffer_get_depth(framebuffer_t *fb);
|
||||
|
||||
// Force fb streaming to the IDE off.
|
||||
void framebuffer_set_streaming(framebuffer_t *fb, bool enable);
|
||||
bool framebuffer_get_streaming(framebuffer_t *fb);
|
||||
|
||||
// Encode jpeg data for transmission over a text channel.
|
||||
void framebuffer_encode(framebuffer_t *fb, uint8_t *ptr, image_t *img);
|
||||
int framebuffer_encoded_size(framebuffer_t *fb, image_t *img);
|
||||
|
@ -76,17 +76,6 @@ static mp_obj_t py_omv_debug_mode() {
|
||||
}
|
||||
static MP_DEFINE_CONST_FUN_OBJ_0(py_omv_debug_mode_obj, py_omv_debug_mode);
|
||||
|
||||
static mp_obj_t py_omv_disable_fb(size_t n_args, const mp_obj_t *args) {
|
||||
framebuffer_t *fb = framebuffer_get(0);
|
||||
|
||||
if (!n_args) {
|
||||
return mp_obj_new_bool(!framebuffer_get_streaming(fb));
|
||||
}
|
||||
framebuffer_set_streaming(fb, !mp_obj_get_int(args[0]));
|
||||
return mp_const_none;
|
||||
}
|
||||
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(py_omv_disable_fb_obj, 0, 1, py_omv_disable_fb);
|
||||
|
||||
static const mp_rom_map_elem_t globals_dict_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_omv) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_version_major), MP_ROM_INT(FIRMWARE_VERSION_MAJOR) },
|
||||
@ -96,8 +85,7 @@ static const mp_rom_map_elem_t globals_dict_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_arch), MP_ROM_PTR(&py_omv_arch_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_board_type), MP_ROM_PTR(&py_omv_board_type_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_board_id), MP_ROM_PTR(&py_omv_board_id_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_debug_mode), MP_ROM_PTR(&py_omv_debug_mode_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_disable_fb), MP_ROM_PTR(&py_omv_disable_fb_obj) }
|
||||
{ MP_ROM_QSTR(MP_QSTR_debug_mode), MP_ROM_PTR(&py_omv_debug_mode_obj) }
|
||||
};
|
||||
|
||||
static MP_DEFINE_CONST_DICT(globals_dict, globals_dict_table);
|
||||
|
@ -8,7 +8,6 @@
|
||||
#
|
||||
# This script shows off how to transfer the frame buffer to your computer as a jpeg image.
|
||||
|
||||
import omv
|
||||
import rpc
|
||||
import sensor
|
||||
import struct
|
||||
@ -18,14 +17,6 @@ sensor.set_pixformat(sensor.RGB565)
|
||||
sensor.set_framesize(sensor.QVGA)
|
||||
sensor.skip_frames(time=2000)
|
||||
|
||||
# Turn off the frame buffer connection to the IDE from the OpenMV Cam side.
|
||||
#
|
||||
# This needs to be done when manually compressing jpeg images at higher quality
|
||||
# so that the OpenMV Cam does not try to stream them to the IDE using a fall back
|
||||
# mechanism if the JPEG image is too large to fit in the IDE JPEG frame buffer on the OpenMV Cam.
|
||||
|
||||
omv.disable_fb(True)
|
||||
|
||||
# The RPC library above is installed on your OpenMV Cam and provides multiple classes for
|
||||
# allowing your OpenMV Cam to be controlled over USB or LAN/WLAN.
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
#
|
||||
# This script shows off how to transfer the frame buffer to your computer as a jpeg image.
|
||||
|
||||
import omv
|
||||
import rpc
|
||||
import sensor
|
||||
|
||||
@ -17,14 +16,6 @@ sensor.set_pixformat(sensor.RGB565)
|
||||
sensor.set_framesize(sensor.QVGA)
|
||||
sensor.skip_frames(time=2000)
|
||||
|
||||
# Turn off the frame buffer connection to the IDE from the OpenMV Cam side.
|
||||
#
|
||||
# This needs to be done when manually compressing jpeg images at higher quality
|
||||
# so that the OpenMV Cam does not try to stream them to the IDE using a fall back
|
||||
# mechanism if the JPEG image is too large to fit in the IDE JPEG frame buffer on the OpenMV Cam.
|
||||
|
||||
omv.disable_fb(True)
|
||||
|
||||
# The RPC library above is installed on your OpenMV Cam and provides multiple classes for
|
||||
# allowing your OpenMV Cam to be controlled over USB or LAN/WLAN.
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
# you can use by going to Tools->Video Tools->Play RSTP Stream.
|
||||
|
||||
import network
|
||||
import omv
|
||||
import rtsp
|
||||
import sensor
|
||||
import time
|
||||
@ -31,14 +30,6 @@ sensor.reset()
|
||||
sensor.set_pixformat(sensor.RGB565)
|
||||
sensor.set_framesize(sensor.VGA)
|
||||
|
||||
# Turn off the frame buffer connection to the IDE from the OpenMV Cam side.
|
||||
#
|
||||
# This needs to be done when manually compressing jpeg images at higher quality
|
||||
# so that the OpenMV Cam does not try to stream them to the IDE using a fall back
|
||||
# mechanism if the JPEG image is too large to fit in the IDE JPEG frame buffer on the OpenMV Cam.
|
||||
|
||||
omv.disable_fb(True)
|
||||
|
||||
# Setup Network Interface
|
||||
|
||||
network_if = network.LAN()
|
||||
|
@ -11,7 +11,6 @@
|
||||
# you can use by going to Tools->Video Tools->Play RSTP Stream.
|
||||
|
||||
import network
|
||||
import omv
|
||||
import rtsp
|
||||
import sensor
|
||||
import time
|
||||
@ -31,14 +30,6 @@ sensor.reset()
|
||||
sensor.set_pixformat(sensor.RGB565)
|
||||
sensor.set_framesize(sensor.VGA)
|
||||
|
||||
# Turn off the frame buffer connection to the IDE from the OpenMV Cam side.
|
||||
#
|
||||
# This needs to be done when manually compressing jpeg images at higher quality
|
||||
# so that the OpenMV Cam does not try to stream them to the IDE using a fall back
|
||||
# mechanism if the JPEG image is too large to fit in the IDE JPEG frame buffer on the OpenMV Cam.
|
||||
|
||||
omv.disable_fb(True)
|
||||
|
||||
# Setup Network Interface
|
||||
|
||||
network_if = network.WLAN(network.STA_IF)
|
||||
|
Loading…
Reference in New Issue
Block a user