Commit Graph

14 Commits

Author SHA1 Message Date
Josef Söntgen 3362216b66 os: clear remaining samples in Audio packet
... instead of potentially producing out-of-bounds write in the source
buffer.

Fixes #3264.
2019-04-09 12:30:34 +02:00
Josef Söntgen 5ceba11982 os: make Audio_out content filler data arg const
Issue #3264.
2019-04-09 12:30:34 +02:00
Norman Feske eba9c15746 Follow practices suggested by "Effective C++"
The patch adjust the code of the base, base-<kernel>, and os repository.
To adapt existing components to fix violations of the best practices
suggested by "Effective C++" as reported by the -Weffc++ compiler
argument. The changes follow the patterns outlined below:

* A class with virtual functions can no longer publicly inherit base
  classed without a vtable. The inherited object may either be moved
  to a member variable, or inherited privately. The latter would be
  used for classes that inherit 'List::Element' or 'Avl_node'. In order
  to enable the 'List' and 'Avl_tree' to access the meta data, the
  'List' must become a friend.

* Instead of adding a virtual destructor to abstract base classes,
  we inherit the new 'Interface' class, which contains a virtual
  destructor. This way, single-line abstract base classes can stay
  as compact as they are now. The 'Interface' utility resides in
  base/include/util/interface.h.

* With the new warnings enabled, all member variables must be explicitly
  initialized. Basic types may be initialized with '='. All other types
  are initialized with braces '{ ... }' or as class initializers. If
  basic types and non-basic types appear in a row, it is nice to only
  use the brace syntax (also for basic types) and align the braces.

* If a class contains pointers as members, it must now also provide a
  copy constructor and assignment operator. In the most cases, one
  would make them private, effectively disallowing the objects to be
  copied. Unfortunately, this warning cannot be fixed be inheriting
  our existing 'Noncopyable' class (the compiler fails to detect that
  the inheriting class cannot be copied and still gives the error).
  For now, we have to manually add declarations for both the copy
  constructor and assignment operator as private class members. Those
  declarations should be prepended with a comment like this:

        /*
         * Noncopyable
         */
        Thread(Thread const &);
        Thread &operator = (Thread const &);

  In the future, we should revisit these places and try to replace
  the pointers with references. In the presence of at least one
  reference member, the compiler would no longer implicitly generate
  a copy constructor. So we could remove the manual declaration.

Issue #465
2018-01-17 12:14:35 +01:00
Norman Feske adb26b5216 API documentation refinements 2017-05-31 13:16:21 +02:00
Norman Feske c1b981ede4 Annotate session interfaces with CAP_QUOTA
The new 'CAP_QUOTA' enum value denotes the capability quota to be
transferred from the client to the server at session-creation time.

Issue #2398
2017-05-31 13:16:04 +02:00
Norman Feske 29b8d609c9 Adjust file headers to refer to the AGPLv3 2017-02-28 12:59:29 +01:00
Josef Söntgen 6d1e417250 os: reset one packet further in Audio_out stream
Since all Audio_out server components loop over the packet stream
queue it is save to reset the tail position to one after the play
position. We have to do this because we do not know exactly when
the play position changes (i.e. the driver has processed the packet)
and we might end up with a tail position before the current play
position.

Issue #1796.
2015-11-29 18:17:09 +01:00
Josef Söntgen 83e5a64864 os: extend Audio_out with queue query method
Issue #1767.
2015-11-09 13:08:30 +01:00
Josef Söntgen de8794321b os: add tail accessor to Audio_out stream
Issue #1767.
2015-11-09 13:08:30 +01:00
Josef Söntgen 663e8fad9b os: increase Audio_out queue size
Issue #1767.
2015-11-09 13:08:30 +01:00
Josef Söntgen a6c5716796 os: add invalidate_all packets to Audio_out
When a stream was stopped it may still contain valid packets that
will be played automatically when the stream is started again. The
invalidate_all() method may be called after stopping the stream to
prevent this.

Issue #1647.
2015-08-21 11:00:57 +02:00
Josef Söntgen 81599f89ea os: decrease Audio::PERIOD to lower latency
To archive lower latency the length of a period was reduced from
2048 (~46ms) to 512 (~11.6ms) samples.

It should be noted that this change probably breaks audio in Qemu on
most systems.

Issue #1644.
2015-08-21 10:59:45 +02:00
Josef Söntgen 2843a70c0e os: add missing header in Audio_out session header
Include <base/signal.h> directly in the session header to make it
self contained rather than depend on including it outside.

Issue #1644.
2015-08-21 10:59:45 +02:00
Norman Feske ca971bbfd8 Move repositories to 'repos/' subdirectory
This patch changes the top-level directory layout as a preparatory
step for improving the tools for managing 3rd-party source codes.
The rationale is described in the issue referenced below.

Issue #1082
2014-05-14 16:08:00 +02:00