Compare commits
5 Commits
pr3023
...
downscale-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0a75ca746 | ||
|
|
f02f2135cd | ||
|
|
9b4360b6b8 | ||
|
|
c8d0f5cdeb | ||
|
|
22d9f0faf4 |
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
static char *
|
static char *
|
||||||
sc_adb_parse_device_ip_from_line(char *line, size_t len) {
|
sc_adb_parse_device_ip_from_line(char *line, size_t len) {
|
||||||
// One line from "ip route" looks lile:
|
// One line from "ip route" looks like:
|
||||||
// "192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.x"
|
// "192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.x"
|
||||||
|
|
||||||
// Get the location of the device name (index of "wlan0" in the example)
|
// Get the location of the device name (index of "wlan0" in the example)
|
||||||
|
|||||||
@@ -3,10 +3,12 @@
|
|||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#include "stddef.h"
|
#include <stddef.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse the ip from the output of `adb shell ip route`
|
* Parse the ip from the output of `adb shell ip route`
|
||||||
|
*
|
||||||
|
* Warning: this function modifies the buffer for optimization purposes.
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
sc_adb_parse_device_ip_from_output(char *buf, size_t buf_len);
|
sc_adb_parse_device_ip_from_output(char *buf, size_t buf_len);
|
||||||
|
|||||||
@@ -106,10 +106,10 @@ sc_str_wrap_lines(const char *input, unsigned columns, unsigned indent);
|
|||||||
/**
|
/**
|
||||||
* Truncate the data after any of the characters from `endchars`
|
* Truncate the data after any of the characters from `endchars`
|
||||||
*
|
*
|
||||||
* An '\0' is always written at the end of the data, even if no newline
|
* An '\0' is always written at the end of the data string, even if no
|
||||||
* character is encountered.
|
* character from `endchars` is encountered.
|
||||||
*
|
*
|
||||||
* Return the size of the resulting line.
|
* Return the size of the resulting string (as strlen() would return).
|
||||||
*/
|
*/
|
||||||
size_t
|
size_t
|
||||||
sc_str_truncate(char *data, size_t len, const char *endchars);
|
sc_str_truncate(char *data, size_t len, const char *endchars);
|
||||||
|
|||||||
@@ -89,13 +89,15 @@ public class ScreenEncoder implements Device.RotationListener {
|
|||||||
Rect unlockedVideoRect = screenInfo.getUnlockedVideoSize().toRect();
|
Rect unlockedVideoRect = screenInfo.getUnlockedVideoSize().toRect();
|
||||||
int videoRotation = screenInfo.getVideoRotation();
|
int videoRotation = screenInfo.getVideoRotation();
|
||||||
int layerStack = device.getLayerStack();
|
int layerStack = device.getLayerStack();
|
||||||
|
|
||||||
setSize(format, videoRect.width(), videoRect.height());
|
setSize(format, videoRect.width(), videoRect.height());
|
||||||
configure(codec, format);
|
|
||||||
Surface surface = codec.createInputSurface();
|
Surface surface = null;
|
||||||
setDisplaySurface(display, surface, videoRotation, contentRect, unlockedVideoRect, layerStack);
|
|
||||||
codec.start();
|
|
||||||
try {
|
try {
|
||||||
|
configure(codec, format);
|
||||||
|
surface = codec.createInputSurface();
|
||||||
|
setDisplaySurface(display, surface, videoRotation, contentRect, unlockedVideoRect, layerStack);
|
||||||
|
codec.start();
|
||||||
|
|
||||||
alive = encode(codec, fd);
|
alive = encode(codec, fd);
|
||||||
// do not call stop() on exception, it would trigger an IllegalStateException
|
// do not call stop() on exception, it would trigger an IllegalStateException
|
||||||
codec.stop();
|
codec.stop();
|
||||||
@@ -119,7 +121,9 @@ public class ScreenEncoder implements Device.RotationListener {
|
|||||||
} finally {
|
} finally {
|
||||||
destroyDisplay(display);
|
destroyDisplay(display);
|
||||||
codec.release();
|
codec.release();
|
||||||
surface.release();
|
if (surface != null) {
|
||||||
|
surface.release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} while (alive);
|
} while (alive);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user