Skip to content

Conversation

@ivancmz
Copy link

@ivancmz ivancmz commented Oct 6, 2025

This pull request includes my previous pull requests and several improvements:

Comprehensively improve README with professional documentation

Transformed README from basic documentation to comprehensive project guide.

Improvements:

  • Better structure with clear sections
  • Visual hierarchy with emojis and formatting
  • Practical examples for common use cases
  • Code snippets for library integration
  • Step-by-step extension development

Makes the project more accessible and attractive for:

  • New users (Quick Start)
  • Developers (API documentation)
  • Contributors (Architecture, Extensions)
  • System integrators (Installation, Troubleshooting)

Implemented standard installation system following Linux/Unix conventions.

Changes to makefile:

  • Added installation directory variables (PREFIX, BINDIR, LIBDIR, INCLUDEDIR)
  • Implemented 'make install' target to install system-wide
  • Implemented 'make uninstall' target to remove installation
  • Support for DESTDIR for package building
  • Support for custom PREFIX for alternative install locations

Installation installs:

  • Executable: /usr/local/bin/panelplayer
  • Library: /usr/local/lib/libpanelplayer.so
  • Header: /usr/local/include/panelplayer/panelplayer_api.h

Updated README.md with:

  • Installation instructions
  • Usage after installation
  • Custom prefix examples
  • Library usage examples

Improve C# example with better structure and command-line argument support

Refactored C# example to follow better organization practices:

  • Split monolithic PanelPlayerExample.cs into separate files:
  • PanelPlayerNative.cs: P/Invoke declarations
  • PanelPlayer.cs: Managed wrapper class
  • Program.cs: Main entry point with argument parsing

Added full command-line argument support matching native PanelPlayer:

  • All options supported: -p, -w, -h, -b, -m, -r, -e, -d, -v
  • Multiple source file support
  • Parameter validation with helpful error messages
  • Verbose mode for debugging
  • Help text similar to native version

Changed from single-target (net9.0) to multi-target (net8.0;net9.0) to support broader range of .NET installations.

  • Updated TargetFramework to TargetFrameworks with both net8.0 and net9.0
  • Updated README to reflect .NET 8.0 compatibility
  • Build now produces binaries for both runtimes
    This allows the example to run on systems with .NET 8.0 LTS or .NET 9.0.

Refactor code to eliminate duplication between main.c and panelplayer_api.c

Created new core module (core.c/core.h) with shared functionality:

  • Time management functions (core_get_time, core_await)
  • Frame processing (core_process_frame)
  • Hardware communication (core_send_frame)
  • Extension management (core_load_extension, core_unload_extension)
  • Shared constants (CORE_MIX_MAXIMUM, CORE_UPDATE_DELAY)
  • Added core_play_decoded_file() function to core.c/core.h
  • Consolidates frame decoding, processing, and timing logic
  • Both main.c and panelplayer_api.c now use the shared function
  • Eliminated ~30 lines of duplicated playback loop code
  • Maintains separation: main.c handles CLI/loader, API handles library interface

Implements duplication functionality (-d parameter)
For driving two identical displays (same image on both displays)

ivancmz and others added 12 commits July 16, 2025 11:32
  - Create panelplayer_api.c/.h with C library interface
  - Add C# wrapper class with P/Invoke bindings
  - Include example C# application demonstrating usage
  - Update makefile to build shared library
  - Add gitignore entries for C# build artifacts
  - Add doxygen style comments to panelplayer_api header file
  - Add README.md to the csharp example
This commit introduces a unified decoder interface that supports multiple
image formats (WebP, JPEG, PNG, BMP, and GIF) in addition to the existing WebP
support. The implementation provides a consistent API regardless of the
underlying image format, enabling PanelPlayer to handle a wider variety
of media sources.

Changes:
- Add decoder.h: Define generic decoder interface with format-agnostic API
- Add decoder.c: Implement automatic format detection and decoding for
  WebP, JPEG, PNG, BMP and GIF formats
- Update main.c: Replace direct WebP API calls with new decoder abstraction
- Update makefile: Add linker flags for libjpeg, libpng, and libgif
- Update readme.md: Document required dependencies and supported formats

The decoder automatically detects the image format based on file headers
and handles both static images (JPEG, PNG) and animations (WebP, GIF)
through a unified interface. This maintains backward compatibility while
extending format support.

Dependencies:
- libwebp-dev (existing)
- libjpeg-dev (new)
- libpng-dev (new)
- libgif-dev (new)
# Conflicts:
#	.gitignore
#	makefile

Merge csharp_api and filetypes_support

Combines multi-format decoder support (WebP, JPEG, PNG, GIF, BMP) from
filetype-support branch with C# API wrapper from csharp_api branch.

Changes:
- Resolved merge conflicts in .gitignore and makefile
- Updated panelplayer_api.c to use new decoder abstraction
- Renamed panelplayer_play_webp_file() to panelplayer_play_file()
- Updated C# wrapper to support all image formats
- Added comprehensive Doxygen documentation to decoder.h
- Updated example code and documentation for multi-format support

The C API and C# wrapper now support:
- WebP (animated and static)
- JPEG (static)
- PNG (static)
- GIF (animated)
- BMP (static, 24/32-bit uncompressed)
Implements vertical duplication functionality in the C API library to match
the -d flag available in the main executable. This allows programmatic control
of duplicate mode through the API.

Changes:
- Add panelplayer_set_duplicate() function to C API
- Add duplicate field to panelplayer_state structure
- Implement row duplication in both panelplayer_play_file() and
  panelplayer_play_frame_bgr()
- Add comprehensive Doxygen documentation for new function
- Add SetDuplicate() method to C# wrapper
- Update C# example documentation

Use case: Driving two identical displays stacked vertically where the image
height is half the total display height (e.g., 240x80 image on 240x160 display).
…_api.c

Created new core module (core.c/core.h) with shared functionality:
- Time management functions (core_get_time, core_await)
- Frame processing (core_process_frame)
- Hardware communication (core_send_frame)
- Extension management (core_load_extension, core_unload_extension)
- Shared constants (CORE_MIX_MAXIMUM, CORE_UPDATE_DELAY)

Benefits:
- Eliminated ~150 lines of duplicated code
- Centralized common logic in a single location
- Improved maintainability and testability
- main.c now focused on CLI parsing
- panelplayer_api.c now focused on API surface
…pport

Refactored C# example to follow better organization practices:
- Split monolithic PanelPlayerExample.cs into separate files:
- PanelPlayerNative.cs: P/Invoke declarations
- PanelPlayer.cs: Managed wrapper class
- Program.cs: Main entry point with argument parsing

Added full command-line argument support matching native PanelPlayer:
- All options supported: -p, -w, -h, -b, -m, -r, -e, -d, -v
- Multiple source file support
- Parameter validation with helpful error messages
- Verbose mode for debugging
- Help text similar to native version

Changed from single-target (net9.0) to multi-target (net8.0;net9.0) to support broader range of .NET installations.
- Updated TargetFramework to TargetFrameworks with both net8.0 and net9.0
- Updated README to reflect .NET 8.0 compatibility
- Build now produces binaries for both runtimes
This allows the example to run on systems with .NET 8.0 LTS or .NET 9.0.

Updated README with comprehensive usage examples and new project structure.
Moved the common playback loop from main.c and panelplayer_api.c into a
shared function in core.c to eliminate code duplication.

Changes:
- Added core_play_decoded_file() function to core.c/core.h
- Consolidates frame decoding, processing, and timing logic
- Both main.c and panelplayer_api.c now use the shared function
- Eliminated ~30 lines of duplicated playback loop code
- Maintains separation: main.c handles CLI/loader, API handles library interface

Benefits:
- Single source of truth for playback timing logic
- Easier to maintain and test
- Consistent behavior between CLI and API
- main.c retains its advanced features (loader, shuffle, verbose)
- panelplayer_api.c remains simple and clean
Implemented standard installation system following Linux/Unix conventions.

Changes to makefile:
- Added installation directory variables (PREFIX, BINDIR, LIBDIR, INCLUDEDIR)
- Implemented 'make install' target to install system-wide
- Implemented 'make uninstall' target to remove installation
- Support for DESTDIR for package building
- Support for custom PREFIX for alternative install locations

Installation installs:
- Executable: /usr/local/bin/panelplayer
- Library: /usr/local/lib/libpanelplayer.so
- Header: /usr/local/include/panelplayer/panelplayer_api.h

Updated README.md with:
- Installation instructions
- Usage after installation
- Custom prefix examples
- Library usage examples

Benefits:
- Makes panelplayer available system-wide
- Follows standard Linux conventions
- Easier for users to integrate the library
- Enables package creation (deb, rpm, etc)
- Professional deployment workflow
Transformed README from basic documentation to comprehensive project guide.

Improvements:
- Better structure with clear sections
- Visual hierarchy with emojis and formatting
- Practical examples for common use cases
- Code snippets for library integration
- Step-by-step extension development

Makes the project more accessible and attractive for:
- New users (Quick Start)
- Developers (API documentation)
- Contributors (Architecture, Extensions)
- System integrators (Installation, Troubleshooting)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant