|
3 | 3 | #include <assert.h>
|
4 | 4 | #include <getopt.h>
|
5 | 5 | #include <stdint.h>
|
| 6 | +#include <stdio.h> |
6 | 7 | #include <unistd.h>
|
7 | 8 |
|
8 | 9 | #include "config.h"
|
9 |
| -#include "recorder.h" |
| 10 | +#include "scrcpy.h" |
10 | 11 | #include "util/log.h"
|
11 | 12 | #include "util/str_util.h"
|
12 | 13 |
|
@@ -382,10 +383,10 @@ parse_rotation(const char *s, uint8_t *rotation) {
|
382 | 383 | static bool
|
383 | 384 | parse_window_position(const char *s, int16_t *position) {
|
384 | 385 | // special value for "auto"
|
385 |
| - static_assert(WINDOW_POSITION_UNDEFINED == -0x8000, "unexpected value"); |
| 386 | + static_assert(SC_WINDOW_POSITION_UNDEFINED == -0x8000, "unexpected value"); |
386 | 387 |
|
387 | 388 | if (!strcmp(s, "auto")) {
|
388 |
| - *position = WINDOW_POSITION_UNDEFINED; |
| 389 | + *position = SC_WINDOW_POSITION_UNDEFINED; |
389 | 390 | return true;
|
390 | 391 | }
|
391 | 392 |
|
@@ -414,7 +415,7 @@ parse_window_dimension(const char *s, uint16_t *dimension) {
|
414 | 415 | }
|
415 | 416 |
|
416 | 417 | static bool
|
417 |
| -parse_port_range(const char *s, struct port_range *port_range) { |
| 418 | +parse_port_range(const char *s, struct sc_port_range *port_range) { |
418 | 419 | long values[2];
|
419 | 420 | size_t count = parse_integers_arg(s, 2, values, 0, 0xFFFF, "port");
|
420 | 421 | if (!count) {
|
@@ -480,31 +481,31 @@ parse_log_level(const char *s, enum sc_log_level *log_level) {
|
480 | 481 | }
|
481 | 482 |
|
482 | 483 | static bool
|
483 |
| -parse_record_format(const char *optarg, enum recorder_format *format) { |
| 484 | +parse_record_format(const char *optarg, enum sc_record_format *format) { |
484 | 485 | if (!strcmp(optarg, "mp4")) {
|
485 |
| - *format = RECORDER_FORMAT_MP4; |
| 486 | + *format = SC_RECORD_FORMAT_MP4; |
486 | 487 | return true;
|
487 | 488 | }
|
488 | 489 | if (!strcmp(optarg, "mkv")) {
|
489 |
| - *format = RECORDER_FORMAT_MKV; |
| 490 | + *format = SC_RECORD_FORMAT_MKV; |
490 | 491 | return true;
|
491 | 492 | }
|
492 | 493 | LOGE("Unsupported format: %s (expected mp4 or mkv)", optarg);
|
493 | 494 | return false;
|
494 | 495 | }
|
495 | 496 |
|
496 |
| -static enum recorder_format |
| 497 | +static enum sc_record_format |
497 | 498 | guess_record_format(const char *filename) {
|
498 | 499 | size_t len = strlen(filename);
|
499 | 500 | if (len < 4) {
|
500 | 501 | return 0;
|
501 | 502 | }
|
502 | 503 | const char *ext = &filename[len - 4];
|
503 | 504 | if (!strcmp(ext, ".mp4")) {
|
504 |
| - return RECORDER_FORMAT_MP4; |
| 505 | + return SC_RECORD_FORMAT_MP4; |
505 | 506 | }
|
506 | 507 | if (!strcmp(ext, ".mkv")) {
|
507 |
| - return RECORDER_FORMAT_MKV; |
| 508 | + return SC_RECORD_FORMAT_MKV; |
508 | 509 | }
|
509 | 510 | return 0;
|
510 | 511 | }
|
|
0 commit comments